浏览代码

first commit

Huang Meng 1 年之前
当前提交
607aaa9dbd
共有 85 个文件被更改,包括 18944 次插入0 次删除
  1. 75 0
      Makefile
  2. 7 0
      README.md
  3. 130 0
      include/VX/vx.h
  4. 1284 0
      include/VX/vx_api.h
  5. 178 0
      include/VX/vx_compatibility.h
  6. 90 0
      include/VX/vx_kernels.h
  7. 80 0
      include/VX/vx_khr_icd.h
  8. 394 0
      include/VX/vx_khr_nn.h
  9. 116 0
      include/VX/vx_nodes.h
  10. 1077 0
      include/VX/vx_types.h
  11. 67 0
      include/VX/vx_vendors.h
  12. 108 0
      include/VX_EXT/vx_amd_nn.h
  13. 268 0
      include/VX_EXT/vx_ext_amd.h
  14. 30 0
      include/VX_EXT/vx_log.h
  15. 35 0
      include/ansjer_ai_cfg.h
  16. 7 0
      include/ax_config.h
  17. 32 0
      include/ax_test_utils.h
  18. 561 0
      include/ax_type.h
  19. 136 0
      include/eznn_api.h
  20. 336 0
      include/libnn/net_api.h
  21. 461 0
      include/tiny_json.c
  22. 176 0
      include/tiny_json.h
  23. 62 0
      include/yolo.h
  24. 83 0
      include_bakbak/VX/vx.h
  25. 3166 0
      include_bakbak/VX/vx_api.h
  26. 238 0
      include_bakbak/VX/vx_compatibility.h
  27. 183 0
      include_bakbak/VX/vx_import.h
  28. 401 0
      include_bakbak/VX/vx_kernels.h
  29. 139 0
      include_bakbak/VX/vx_khr_class.h
  30. 80 0
      include_bakbak/VX/vx_khr_icd.h
  31. 158 0
      include_bakbak/VX/vx_khr_ix.h
  32. 532 0
      include_bakbak/VX/vx_khr_nn.h
  33. 372 0
      include_bakbak/VX/vx_khr_tiling.h
  34. 156 0
      include_bakbak/VX/vx_khr_xml.h
  35. 967 0
      include_bakbak/VX/vx_nodes.h
  36. 1891 0
      include_bakbak/VX/vx_types.h
  37. 67 0
      include_bakbak/VX/vx_vendors.h
  38. 946 0
      include_bakbak/VX/vxu.h
  39. 166 0
      include_bakbak/VX_EXT/vx_amd_nn.h
  40. 627 0
      include_bakbak/VX_EXT/vx_ext_amd.h
  41. 30 0
      include_bakbak/VX_EXT/vx_log.h
  42. 34 0
      include_bakbak/ansjer_ai_cfg.h
  43. 7 0
      include_bakbak/ax_config.h
  44. 32 0
      include_bakbak/ax_test_utils.h
  45. 561 0
      include_bakbak/ax_type.h
  46. 136 0
      include_bakbak/eznn_api.h
  47. 11 0
      include_bakbak/libnn/img_type.h
  48. 269 0
      include_bakbak/libnn/net_api.h
  49. 461 0
      include_bakbak/tiny_json.c
  50. 176 0
      include_bakbak/tiny_json.h
  51. 62 0
      include_bakbak/yolo.h
  52. 二进制
      libs/liblog.so
  53. 45 0
      main.cpp
  54. 0 0
      model_and_data/images.yuv
  55. 0 0
      model_and_data/images_media_post.yuv
  56. 二进制
      model_and_data/model_crowdhuman.bin
  57. 二进制
      model_and_data/model_crowdhuman.ezb
  58. 二进制
      model_and_data/model_fire.bin
  59. 二进制
      model_and_data/model_fire.ezb
  60. 二进制
      model_and_data/model_pet.bin
  61. 二进制
      model_and_data/model_pet.ezb
  62. 18 0
      model_and_data/yolo_config.json
  63. 17 0
      model_and_data/yolo_config_crowdhuman.json
  64. 二进制
      model_and_data/yolov5.bin
  65. 二进制
      model_and_data/yolov5.ezb
  66. 18 0
      model_and_data/yolov5_config_fire.json
  67. 18 0
      model_and_data/yolov5_config_pet.json
  68. 18 0
      model_and_data/yolov8_config_fire.json
  69. 二进制
      out/images.yuv
  70. 二进制
      out/libs/liblog.so
  71. 二进制
      out/libs/libnn_yolo.so
  72. 二进制
      out/model.bin
  73. 二进制
      out/model.ezb
  74. 二进制
      out/nn_yolo_test
  75. 10 0
      out/run_on_board.sh
  76. 18 0
      out/yolo_config.json
  77. 10 0
      run_on_board.sh
  78. 31 0
      yolo/Makefile
  79. 78 0
      yolo/ansjer_ai_cfg.c
  80. 二进制
      yolo/libnn_yolo.so
  81. 627 0
      yolo/yolo.cpp
  82. 36 0
      yolo_test/Makefile
  83. 二进制
      yolo_test/nn_yolo_test
  84. 234 0
      yolo_test/utils.cpp
  85. 105 0
      yolo_test/yolo_test.cpp

+ 75 - 0
Makefile

@@ -0,0 +1,75 @@
+SDK_ROOT := $(PWD)/../../
+
+all:
+	@make pkg
+#	@make mount
+
+pkg:
+	@make clean
+	@make compile
+	@make copy
+
+mount:
+	@make mount_clean
+	@make mount_compile
+	@make mount_copy
+#	@make nfs
+
+compile:
+	@cd yolo;  make
+
+clean:
+	@cd yolo; make clean
+
+copy:
+# 	copy .so
+	@cp yolo/libnn_yolo.so ../../frameworks/nn/lib/n7v3/armhf/custom/libnn_customdet.so
+
+#	yolov5 fire
+	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov5ToEZB/yolov5_fire_prune_384x640/model_ezb/model_fire_prune_384x640.bin ../../frameworks/nn/lib/n7v3/models/custom/yolov5_fire.bin
+	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov5ToEZB/yolov5_fire_prune_384x640/model_ezb/model_fire_prune_384x640.ezb ../../frameworks/nn/lib/n7v3/models/custom/yolov5_fire.ezb
+	@cp model_and_data/yolov5_config_fire.json ../../frameworks/nn/lib/n7v3/armhf/custom/yolov5_config_fire.json
+
+#	yolov8 fire
+#	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov8ToEZB/model_fire/model_ezb/model_fire.bin ../../frameworks/nn/lib/n7v3/models/custom/yolov8_fire.bin
+#	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov8ToEZB/model_fire/model_ezb/model_fire.ezb ../../frameworks/nn/lib/n7v3/models/custom/yolov8_fire.ezb
+#	@cp model_and_data/yolov8_config_fire.json ../../frameworks/nn/lib/n7v3/armhf/custom/yolov8_config_fire.json
+
+#	yolov5 pet
+	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov5ToEZB/yolov5_pet_prune_384x640/model_ezb/yolov5_pet_prune_384x640.bin ../../frameworks/nn/lib/n7v3/models/custom/yolov5_pet.bin
+	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov5ToEZB/yolov5_pet_prune_384x640/model_ezb/yolov5_pet_prune_384x640.ezb ../../frameworks/nn/lib/n7v3/models/custom/yolov5_pet.ezb
+	@cp model_and_data/yolov5_config_pet.json ../../frameworks/nn/lib/n7v3/armhf/custom/yolov5_config_pet.json
+
+mount_compile:
+	@cd yolo;  make
+	@cd yolo_test; make
+
+mount_clean:
+	@cd yolo; make clean
+	@cd yolo_test; make clean
+	@rm -rf out
+
+nfs:
+	@rm -rf /home/ubuntu/nfs/*
+	@cp -r out/* /home/ubuntu/nfs/
+
+mount_copy:
+	@mkdir -p out
+	@mkdir -p out/res_hw
+	@cp -r libs out
+	@cp -r yolo/libnn_yolo.so out/libs
+	@cp run_on_board.sh out/
+	@cp yolo_test/nn_yolo_test out/
+	@cp model_and_data/yolo_config.json out/yolo_config.json
+
+#   yolov5
+	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov5ToEZB/yolov5_fire_prune_384x640/sim/res_hw/images.yuv out/
+	@cp model_and_data/yolo_config.json out/yolo_config.json
+	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov5ToEZB/yolov5_fire_prune_384x640/model_ezb/model_fire_prune_384x640.bin out/model.bin
+	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov5ToEZB/yolov5_fire_prune_384x640/model_ezb/model_fire_prune_384x640.ezb out/model.ezb
+
+#	yolov8
+#	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov8ToEZB/model_fire/sim/res/images.yuv out/
+#	@cp /root/eeasy/eeasy_repo/sv82x-v1.1-yolo/apps/inference/model_and_data/yolo_config.json out/yolo_config.json
+#	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov8ToEZB/model_fire/model_ezb/model_fire.bin out/model.bin
+#	@cp /root/eeasy/eeasy_quan/eeasy_yolo/yolov8ToEZB/model_fire/model_ezb/model_fire.ezb out/model.ezb

+ 7 - 0
README.md

@@ -0,0 +1,7 @@
+# 使用说明
+
+    1. make clean
+    2. make complie
+    3. cp yolo/libnn_yolo.so frameworks/nn/lib/n7v3/armhf/custom/libnn_customdet.so 替换SDK里面的so
+    4. cp ezb和bin模型文件到 frameworks/nn/lib/n7v3/models/custom 目录下
+    5. cp 对应的json文件到 frameworks/nn/lib/n7v3/armhf/custom 目录下

+ 130 - 0
include/VX/vx.h

@@ -0,0 +1,130 @@
+/* 
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_H_
+#define _OPENVX_H_
+
+/*!
+ * \file
+ * \brief The top level OpenVX Header.
+ */
+
+/*! \brief Defines the length of the implementation name string, including the trailing zero.
+ * \ingroup group_context
+ */
+#define VX_MAX_IMPLEMENTATION_NAME (64)
+
+/*! \brief Defines the length of a kernel name string to be added to OpenVX, including the trailing zero.
+ * \ingroup group_kernel
+ */
+#define VX_MAX_KERNEL_NAME (128)
+
+#include <VX/vx_vendors.h>
+#include <VX/vx_types.h>
+#include <VX/vx_kernels.h>
+#include <VX/vx_api.h>
+#include <VX/vx_nodes.h>
+
+/*! \brief Defines the major version number macro.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_MAJOR(x) ((x & 0xFF) << 8)
+
+/*! \brief Defines the minor version number macro.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_MINOR(x) ((x & 0xFF) << 0)
+
+/*! \brief Defines the predefined version number for 1.0.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_1_0      (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(0))
+
+/*! \brief Defines the predefined version number for 1.1.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_1_1      (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(1))
+
+/*! \brief Defines the predefined version number for 1.2.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_1_2      (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(2))
+
+/*! \brief Defines the OpenVX Version Number.
+ * \ingroup group_basic_features
+ */
+//#define VX_VERSION          VX_VERSION_1_2
+
+#define BUILD_YEAR_CH0 (__DATE__[ 7])
+#define BUILD_YEAR_CH1 (__DATE__[ 8])
+#define BUILD_YEAR_CH2 (__DATE__[ 9])
+#define BUILD_YEAR_CH3 (__DATE__[10])
+
+#define BUILD_MONTH_IS_JAN (__DATE__[0] == 'J' && __DATE__[1] == 'a' && __DATE__[2] == 'n')
+#define BUILD_MONTH_IS_FEB (__DATE__[0] == 'F')
+#define BUILD_MONTH_IS_MAR (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'r')
+#define BUILD_MONTH_IS_APR (__DATE__[0] == 'A' && __DATE__[1] == 'p')
+#define BUILD_MONTH_IS_MAY (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'y')
+#define BUILD_MONTH_IS_JUN (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'n')
+#define BUILD_MONTH_IS_JUL (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'l')
+#define BUILD_MONTH_IS_AUG (__DATE__[0] == 'A' && __DATE__[1] == 'u')
+#define BUILD_MONTH_IS_SEP (__DATE__[0] == 'S')
+#define BUILD_MONTH_IS_OCT (__DATE__[0] == 'O')
+#define BUILD_MONTH_IS_NOV (__DATE__[0] == 'N')
+#define BUILD_MONTH_IS_DEC (__DATE__[0] == 'D')
+#define BUILD_MONTH_CH0 ((BUILD_MONTH_IS_OCT || BUILD_MONTH_IS_NOV || BUILD_MONTH_IS_DEC) ? '1' : '0')
+#define BUILD_MONTH_CH1 ( \
+    (BUILD_MONTH_IS_JAN) ? '1' : \
+    (BUILD_MONTH_IS_FEB) ? '2' : \
+    (BUILD_MONTH_IS_MAR) ? '3' : \
+    (BUILD_MONTH_IS_APR) ? '4' : \
+    (BUILD_MONTH_IS_MAY) ? '5' : \
+    (BUILD_MONTH_IS_JUN) ? '6' : \
+    (BUILD_MONTH_IS_JUL) ? '7' : \
+    (BUILD_MONTH_IS_AUG) ? '8' : \
+    (BUILD_MONTH_IS_SEP) ? '9' : \
+    (BUILD_MONTH_IS_OCT) ? '0' : \
+    (BUILD_MONTH_IS_NOV) ? '1' : \
+    (BUILD_MONTH_IS_DEC) ? '2' : '?'  \
+)
+
+#define BUILD_DAY_CH0 ((__DATE__[4] >= '0') ? (__DATE__[4]) : '0')
+#define BUILD_DAY_CH1 (__DATE__[5])
+
+#define BUILD_HOUR_CH0 (__TIME__[0])
+#define BUILD_HOUR_CH1 (__TIME__[1])
+
+#define BUILD_MIN_CH0 (__TIME__[3])
+#define BUILD_MIN_CH1 (__TIME__[4])
+
+#define BUILD_SEC_CH0 (__TIME__[6])
+#define BUILD_SEC_CH1 (__TIME__[7])
+
+#define VX_VERSION { \
+    '1', \
+    '.', \
+    '3', \
+    '.', \
+    BUILD_YEAR_CH0, BUILD_YEAR_CH1, BUILD_YEAR_CH2, BUILD_YEAR_CH3, \
+    BUILD_MONTH_CH0, BUILD_MONTH_CH1, \
+    BUILD_DAY_CH0, BUILD_DAY_CH1, \
+    '.', \
+    BUILD_HOUR_CH0, BUILD_HOUR_CH1, \
+    '\0' \
+}
+
+#endif

+ 1284 - 0
include/VX/vx_api.h

@@ -0,0 +1,1284 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_API_H_
+#define _OPENVX_API_H_
+
+/*!
+ * \file
+ * \brief The API definition for OpenVX.
+ */
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/*==============================================================================
+ CONTEXT
+ =============================================================================*/
+
+/*! \brief Creates a <tt>\ref vx_context</tt>.
+ * \details This creates a top-level object context for OpenVX.
+ * \note This is required to do anything else.
+ * \returns The reference to the implementation context <tt>\ref vx_context</tt>. Any possible errors
+ * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_context
+ * \post <tt>\ref vxReleaseContext</tt>
+ */
+VX_API_ENTRY vx_context VX_API_CALL vxCreateContext(void);
+
+/*! \brief Releases the OpenVX object context.
+ * \details All reference counted objects are garbage-collected by the return of this call.
+ * No calls are possible using the parameter context after the context has been
+ * released until a new reference from <tt>\ref vxCreateContext</tt> is returned.
+ * All outstanding references to OpenVX objects from this context are invalid
+ * after this call.
+ * \param [in] context The pointer to the reference to the context.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \ingroup group_context
+ * \pre <tt>\ref vxCreateContext</tt>
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseContext(vx_context *context);
+
+/*! \brief Retrieves the context from any reference from within a context.
+ * \param [in] reference The reference from which to extract the context.
+ * \ingroup group_context
+ * \return The overall context that created the particular
+ * reference. Any possible errors preventing a successful completion of this function
+ * should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_context VX_API_CALL vxGetContext(vx_reference reference);
+
+/*! \brief Queries the context for some specific information.
+ * \param [in] context The reference to the context.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_context_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not supported on this implementation.
+ * \ingroup group_context
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryContext(vx_context context, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Sets an attribute on the context.
+ * \param [in] context The handle to the overall context.
+ * \param [in] attribute The attribute to set from <tt>\ref vx_context_attribute_e</tt>.
+ * \param [in] ptr The pointer to the data to which to set the attribute.
+ * \param [in] size The size in bytes of the data to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not settable.
+ * \ingroup group_context
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetContextAttribute(vx_context context, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Provides a generic API to give platform-specific hints to the implementation.
+ * \param [in] reference The reference to the object to hint at.
+ * This could be <tt>\ref vx_context</tt>, <tt>\ref vx_graph</tt>, <tt>\ref vx_node</tt>, <tt>\ref vx_image</tt>, <tt>\ref vx_array</tt>, or any other reference.
+ * \param [in] hint A <tt>\ref vx_hint_e</tt> \a hint to give to a \ref vx_context. This is a platform-specific optimization or implementation mechanism.
+ * \param [in] data Optional vendor specific data.
+ * \param [in] data_size Size of the data structure \p data.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE reference is not a valid <tt>\ref vx_reference</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED If the hint is not supported.
+ * \ingroup group_hint
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxHint(vx_reference reference, vx_enum hint, const void* data, vx_size data_size);
+
+/*! \brief Provides a generic API to give platform-specific directives to the implementations.
+ * \param [in] reference The reference to the object to set the directive on.
+ * This could be <tt>\ref vx_context</tt>, <tt>\ref vx_graph</tt>, <tt>\ref vx_node</tt>, <tt>\ref vx_image</tt>, <tt>\ref vx_array</tt>, or any other reference.
+ * \param [in] directive The directive to set. See <tt>\ref vx_directive_e</tt>.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE reference is not a valid <tt>\ref vx_reference</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED If the directive is not supported.
+ * \note The performance counter directives are only available for the reference \ref vx_context.
+ *       Error VX_ERROR_NOT_SUPPORTED is returned when used with any other reference.
+ * \ingroup group_directive
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxDirective(vx_reference reference, vx_enum directive);
+
+/*! \brief Provides a generic API to return status values from Object constructors if they
+ * fail.
+ * \note Users do not need to strictly check every object creator as the errors
+ * should properly propagate and be detected during verification time or run-time.
+ * \code
+ * vx_image img = vxCreateImage(context, 639, 480, VX_DF_IMAGE_UYVY);
+ * vx_status status = vxGetStatus((vx_reference)img);
+ * // status == VX_ERROR_INVALID_DIMENSIONS
+ * vxReleaseImage(&img);
+ * \endcode
+ * \pre Appropriate Object Creator function.
+ * \post Appropriate Object Release function.
+ * \param [in] reference The reference to check for construction errors.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval * Some error occurred, please check enumeration list and constructor.
+ * \ingroup group_basic_features
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxGetStatus(vx_reference reference);
+
+/*!
+ * \brief Registers user-defined structures to the context.
+ * \param [in] context  The reference to the implementation context.
+ * \param [in] size     The size of user struct in bytes.
+ * \return A <tt>\ref vx_enum</tt> value that is a type given to the User
+ * to refer to their custom structure when declaring a <tt>\ref vx_array</tt>
+ * of that structure.
+ * \retval VX_TYPE_INVALID If the namespace of types has been exhausted.
+ * \note This call should only be used once within the lifetime of a context for
+ * a specific structure.
+ * \ingroup group_adv_array
+ */
+VX_API_ENTRY vx_enum VX_API_CALL vxRegisterUserStruct(vx_context context, vx_size size);
+
+/*!
+ * \brief Allocates and registers user-defined kernel enumeration to a context.
+ * The allocated enumeration is from available pool of 4096 enumerations reserved
+ * for dynamic allocation from VX_KERNEL_BASE(VX_ID_USER,0).
+ * \param [in] context  The reference to the implementation context.
+ * \param [out] pKernelEnumId  pointer to return <tt>\ref vx_enum</tt> for user-defined kernel.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE If the context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_NO_RESOURCES The enumerations has been exhausted.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAllocateUserKernelId(vx_context context, vx_enum * pKernelEnumId);
+
+/*!
+ * \brief Allocates and registers user-defined kernel library ID to a context.
+ *
+ * The allocated library ID is from available pool of library IDs (1..255)
+ * reserved for dynamic allocation. The returned libraryId can be used by
+ * user-kernel library developer to specify individual kernel enum IDs in
+ * a header file, shown below:
+ * \code
+ * #define MY_KERNEL_ID1(libraryId) (VX_KERNEL_BASE(VX_ID_USER,libraryId) + 0);
+ * #define MY_KERNEL_ID2(libraryId) (VX_KERNEL_BASE(VX_ID_USER,libraryId) + 1);
+ * #define MY_KERNEL_ID3(libraryId) (VX_KERNEL_BASE(VX_ID_USER,libraryId) + 2);
+ * \endcode
+ * \param [in] context  The reference to the implementation context.
+ * \param [out] pLibraryId  pointer to <tt>\ref vx_enum</tt> for user-kernel libraryId.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_NO_RESOURCES The enumerations has been exhausted.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAllocateUserKernelLibraryId(vx_context context, vx_enum * pLibraryId);
+
+/*! \brief Sets the default target of the immediate mode. Upon successful execution of this
+ * function any future execution of immediate mode function is attempted on the new default
+ * target of the context.
+ * \param [in] context  The reference to the implementation context.
+ * \param [in] target_enum  The default immediate mode target enum to be set
+ * to the <tt>\ref vx_context</tt> object. Use a <tt>\ref vx_target_e</tt>.
+ * \param [in] target_string  The target name ASCII string. This contains a valid value
+ * when target_enum is set to <tt>\ref VX_TARGET_STRING</tt>, otherwise it is ignored.
+ * \ingroup group_context
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Default target set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE If the context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED If the specified target is not supported in this context.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetImmediateModeTarget(vx_context context, vx_enum target_enum, const char* target_string);
+
+/*==============================================================================
+ KERNEL
+ =============================================================================*/
+
+/*! \brief Loads a library of kernels, called module, into a context.
+ *
+ * The module must be a dynamic library with by convention, two exported functions
+ * named <tt>vxPublishKernels</tt> and <tt>vxUnpublishKernels</tt>.
+ *
+ * <tt>vxPublishKernels</tt> must have type <tt>\ref vx_publish_kernels_f</tt>,
+ * and must add kernels to the context by calling <tt>\ref vxAddUserKernel</tt>
+ * for each new kernel. <tt>vxPublishKernels</tt> is called by <tt>\ref vxLoadKernels</tt>.
+ *
+ * <tt>vxUnpublishKernels</tt> must have type <tt>\ref vx_unpublish_kernels_f</tt>,
+ * and must remove kernels from the context by calling <tt>\ref vxRemoveKernel</tt>
+ * for each kernel the <tt>vxPublishKernels</tt> has added.
+ * <tt>vxUnpublishKernels</tt> is called by <tt>\ref vxUnloadKernels</tt>.
+ *
+ * \note When all references to loaded kernels are released, the module
+ * may be automatically unloaded.
+ * \param [in] context The reference to the context the kernels must be added to.
+ * \param [in] module The short name of the module to load. On systems where
+ * there are specific naming conventions for modules, the name passed
+ * should ignore such conventions. For example: \c libxyz.so should be
+ * passed as just \c xyz and the implementation will <i>do the right thing</i> that
+ * the platform requires.
+ * \note This API uses the system pre-defined paths for modules.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \ingroup group_user_kernels
+ * \see vxGetKernelByName
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxLoadKernels(vx_context context, const vx_char *module);
+
+/*! \brief Unloads all kernels from the OpenVX context that had been loaded from
+ * the module using the \ref vxLoadKernels function.
+ *
+ * The kernel unloading is performed by calling the <tt>vxUnpublishKernels</tt>
+ * exported function of the module.
+ * \note <tt>vxUnpublishKernels</tt> is defined in the description of
+ * <tt>\ref vxLoadKernels</tt>.
+ *
+ * \param [in] context The reference to the context the kernels must be removed from.
+ * \param [in] module The short name of the module to unload. On systems where
+ * there are specific naming conventions for modules, the name passed
+ * should ignore such conventions. For example: \c libxyz.so should be
+ * passed as just \c xyz and the implementation will <i>do the right thing</i>
+ * that the platform requires.
+ * \note This API uses the system pre-defined paths for modules.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are
+ incorrect.
+ * \ingroup group_user_kernels
+ * \see vxLoadKernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxUnloadKernels(vx_context context, const vx_char *module);
+
+/*! \brief Obtains a reference to a kernel using a string to specify the name.
+ * \details User Kernels follow a "dotted" heirarchical syntax. For example:
+ * "com.company.example.xyz". The following are strings specifying the kernel names:
+
+ * org.khronos.openvx.color_convert
+
+ * org.khronos.openvx.channel_extract
+
+ * org.khronos.openvx.channel_combine
+
+ * org.khronos.openvx.sobel_3x3
+
+ * org.khronos.openvx.magnitude
+
+ * org.khronos.openvx.phase
+
+ * org.khronos.openvx.scale_image
+
+ * org.khronos.openvx.table_lookup
+
+ * org.khronos.openvx.histogram
+
+ * org.khronos.openvx.equalize_histogram
+
+ * org.khronos.openvx.absdiff
+
+ * org.khronos.openvx.mean_stddev
+
+ * org.khronos.openvx.threshold
+
+ * org.khronos.openvx.integral_image
+
+ * org.khronos.openvx.dilate_3x3
+
+ * org.khronos.openvx.erode_3x3
+
+ * org.khronos.openvx.median_3x3
+
+ * org.khronos.openvx.box_3x3
+
+ * org.khronos.openvx.gaussian_3x3
+
+ * org.khronos.openvx.custom_convolution
+
+ * org.khronos.openvx.gaussian_pyramid
+
+ * org.khronos.openvx.accumulate
+
+ * org.khronos.openvx.accumulate_weighted
+
+ * org.khronos.openvx.accumulate_square
+
+ * org.khronos.openvx.minmaxloc
+
+ * org.khronos.openvx.convertdepth
+
+ * org.khronos.openvx.canny_edge_detector
+
+ * org.khronos.openvx.and
+
+ * org.khronos.openvx.or
+
+ * org.khronos.openvx.xor
+
+ * org.khronos.openvx.not
+
+ * org.khronos.openvx.multiply
+
+ * org.khronos.openvx.add
+
+ * org.khronos.openvx.subtract
+
+ * org.khronos.openvx.warp_affine
+
+ * org.khronos.openvx.warp_perspective
+
+ * org.khronos.openvx.harris_corners
+
+ * org.khronos.openvx.fast_corners
+
+ * org.khronos.openvx.optical_flow_pyr_lk
+
+ * org.khronos.openvx.remap
+
+ * org.khronos.openvx.halfscale_gaussian
+
+ * org.khronos.openvx.laplacian_pyramid
+
+ * org.khronos.openvx.laplacian_reconstruct
+
+ * org.khronos.openvx.non_linear_filter
+
+ * org.khronos.openvx.match_template
+
+ * org.khronos.openvx.lbp
+
+ * org.khronos.openvx.hough_lines_p
+
+ * org.khronos.openvx.tensor_multiply
+ 
+ * org.khronos.openvx.tensor_add
+ 
+ * org.khronos.openvx.tensor_subtract
+ 
+ * org.khronos.openvx.tensor_table_lookup
+ 
+ * org.khronos.openvx.tensor_transpose
+ 
+ * org.khronos.openvx.tensor_convert_depth
+ 
+ * org.khronos.openvx.tensor_matrix_multiply
+ 
+ * org.khronos.openvx.copy
+ 
+ * org.khronos.openvx.non_max_suppression
+ 
+ * org.khronos.openvx.scalar_operation
+ 
+ * org.khronos.openvx.hog_features
+ 
+ * org.khronos.openvx.hog_cells
+ 
+ * org.khronos.openvx.bilateral_filter
+
+ * org.khronos.openvx.select
+
+ * org.khronos.openvx.min
+
+ * org.khronos.openvx.max
+
+ * \param [in] context The reference to the implementation context.
+ * \param [in] name The string of the name of the kernel to get.
+ * \return A kernel reference. Any possible errors preventing a successful
+ * completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_kernel
+ * \pre <tt>\ref vxLoadKernels</tt> if the kernel is not provided by the
+ * OpenVX implementation.
+ * \note User Kernels should follow a "dotted" hierarchical syntax. For example:
+ * "com.company.example.xyz".
+ */
+VX_API_ENTRY vx_kernel VX_API_CALL vxGetKernelByName(vx_context context, const vx_char *name);
+
+/*! \brief Obtains a reference to the kernel using the <tt>\ref vx_kernel_e</tt> enumeration.
+ * \details Enum values above the standard set are assumed to apply to
+ * loaded libraries.
+ * \param [in] context The reference to the implementation context.
+ * \param [in] kernel A value from <tt>\ref vx_kernel_e</tt> or a vendor or client-defined value.
+ * \return A <tt>\ref vx_kernel</tt> reference. Any possible errors preventing a successful completion
+ * of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_kernel
+ * \pre <tt>\ref vxLoadKernels</tt> if the kernel is not provided by the
+ * OpenVX implementation.
+ */
+VX_API_ENTRY vx_kernel VX_API_CALL vxGetKernelByEnum(vx_context context, vx_enum kernel);
+
+/*! \brief This allows the client to query the kernel to get information about
+ * the number of parameters, enum values, etc.
+ * \param [in] kernel The kernel reference to query.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_kernel_attribute_e</tt>.
+ * \param [out] ptr The pointer to the location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute value is not supported in this implementation.
+ * \ingroup group_kernel
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryKernel(vx_kernel kernel, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Release the reference to the kernel.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] kernel The pointer to the kernel reference to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \ingroup group_kernel
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseKernel(vx_kernel *kernel);
+
+/*! \brief Allows users to add custom kernels to a context at run-time.
+ * \param [in] context The reference to the context the kernel must be added to.
+ * \param [in] name The string to use to match the kernel.
+ * \param [in] enumeration The enumerated value of the kernel to be used by clients.
+ * \param [in] func_ptr The process-local function pointer to be invoked.
+ * \param [in] numParams The number of parameters for this kernel.
+ * \param [in] validate The pointer to <tt>\ref vx_kernel_validate_f</tt>, which validates
+ * parameters to this kernel.
+ * \param [in] init The kernel initialization function.
+ * \param [in] deinit The kernel de-initialization function.
+ * \return A <tt>\ref vx_kernel</tt> reference. Any possible errors
+ * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_kernel VX_API_CALL vxAddUserKernel(vx_context context,
+                             const vx_char name[VX_MAX_KERNEL_NAME],
+                             vx_enum enumeration,
+                             vx_kernel_f func_ptr,
+                             vx_uint32 numParams,
+                             vx_kernel_validate_f validate,
+                             vx_kernel_initialize_f init,
+                             vx_kernel_deinitialize_f deinit);
+
+/*! \brief This API is called after all parameters have been added to the
+ * kernel and the kernel is \e ready to be used. Notice that the reference to the kernel created
+ * by vxAddUserKernel is still valid after the call to vxFinalizeKernel.
+ * If an error occurs, the kernel is not available for usage by the clients of OpenVX. Typically
+ * this is due to a mismatch between the number of parameters requested and given.
+ * \param [in] kernel The reference to the loaded kernel from <tt>\ref vxAddUserKernel</tt>.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \pre <tt>\ref vxAddUserKernel</tt> and <tt>\ref vxAddParameterToKernel</tt>
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxFinalizeKernel(vx_kernel kernel);
+
+/*! \brief Allows users to set the signatures of the custom kernel.
+ * \param [in] kernel The reference to the kernel added with <tt>\ref vxAddUserKernel</tt>.
+ * \param [in] index The index of the parameter to add.
+ * \param [in] dir The direction of the parameter. This must be either <tt>\ref VX_INPUT</tt> or
+ * <tt>\ref VX_OUTPUT</tt>. <tt>\ref VX_BIDIRECTIONAL</tt> is not supported for this function.
+ * \param [in] data_type The type of parameter. This must be a value from <tt>\ref vx_type_e</tt>.
+ * \param [in] state The state of the parameter (required or not). This must be a value from <tt>\ref vx_parameter_state_e</tt>.
+ * \return A <tt>\ref vx_status_e</tt> enumerated value.
+ * \retval VX_SUCCESS Parameter is successfully set on kernel; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If the parameter is not valid for any reason.
+ * \pre <tt>\ref vxAddUserKernel</tt>
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAddParameterToKernel(vx_kernel kernel, vx_uint32 index, vx_enum dir, vx_enum data_type, vx_enum state);
+
+/*! \brief Removes a custom kernel from its context and releases it.
+ * \param [in] kernel The reference to the kernel to remove. Returned from <tt>\ref vxAddUserKernel</tt>.
+ * \note Any kernel enumerated in the base standard
+ * cannot be removed; only kernels added through <tt>\ref vxAddUserKernel</tt> can
+ * be removed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration. The function returns to the
+ * application full control over the memory resources provided at the kernel creation time.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If a base kernel is passed in.
+ * \retval VX_FAILURE If the application has not released all references to the kernel
+ * object OR if the application has not released all references to a node that is using
+ * this kernel OR if the application has not released all references to a graph which
+ * has nodes that is using this kernel.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxRemoveKernel(vx_kernel kernel);
+
+/*! \brief Sets kernel attributes.
+ * \param [in] kernel The reference to the kernel.
+ * \param [in] attribute The enumeration of the attributes. See <tt>\ref vx_kernel_attribute_e</tt>.
+ * \param [in] ptr The pointer to the location from which to read the attribute.
+ * \param [in] size The size in bytes of the data area indicated by \a ptr in bytes.
+ * \note After a kernel has been passed to <tt>\ref vxFinalizeKernel</tt>, no attributes
+ * can be altered.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetKernelAttribute(vx_kernel kernel, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Retrieves a <tt>\ref vx_parameter</tt> from a <tt>\ref vx_kernel</tt>.
+ * \param [in] kernel The reference to the kernel.
+ * \param [in] index The index of the parameter.
+ * \return A <tt>\ref vx_parameter</tt> reference. Any possible errors preventing a
+ * successful completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_parameter
+ */
+VX_API_ENTRY vx_parameter VX_API_CALL vxGetKernelParameterByIndex(vx_kernel kernel, vx_uint32 index);
+
+/*==============================================================================
+ GRAPH
+ =============================================================================*/
+
+/*! \brief Creates an empty graph.
+ * \param [in] context The reference to the implementation context.
+ * \returns A graph reference <tt>\ref vx_graph</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_graph VX_API_CALL vxCreateGraph(vx_context context);
+
+/*! \brief Releases a reference to a graph.
+ * The object may not be garbage collected until its total reference count is zero.
+ * Once the reference count is zero, all node references in the graph are automatically
+ * released as well. Releasing the graph will only release the nodes if the nodes were
+ * not previously released by the application. Data referenced by those nodes may not
+ * be released as the user may still have references to the data.
+ * \param [in] graph The pointer to the graph to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseGraph(vx_graph *graph);
+
+/*! \brief Verifies the state of the graph before it is executed.
+ * This is useful to catch programmer errors and contract errors. If not verified,
+ * the graph verifies before being processed.
+ * \pre Memory for data objects is not guarenteed to exist before
+ * this call. \post After this call data objects exist unless
+ * the implementation optimized them out.
+ * \param [in] graph The reference to the graph to verify.
+ * \return A status code for graphs with more than one error; it is
+ * undefined which error will be returned. Register a log callback using <tt>\ref vxRegisterLogCallback</tt>
+ * to receive each specific error in the graph.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \retval VX_ERROR_MULTIPLE_WRITERS If the graph contains more than one writer
+ * to any data object.
+ * \retval VX_ERROR_INVALID_NODE If a node in the graph is invalid or failed be created.
+ * \retval VX_ERROR_INVALID_GRAPH If the graph contains cycles or some other invalid topology.
+ * \retval VX_ERROR_INVALID_TYPE If any parameter on a node is given the wrong type.
+ * \retval VX_ERROR_INVALID_VALUE If any value of any parameter is out of bounds of specification.
+ * \retval VX_ERROR_INVALID_FORMAT If the image format is not compatible.
+ * \ingroup group_graph
+ * \see vxProcessGraph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxVerifyGraph(vx_graph graph);
+
+/*! \brief This function causes the synchronous processing of a graph. If the graph
+ * has not been verified, then the implementation verifies the graph
+ * immediately. If verification fails this function returns a status
+ * identical to what <tt>\ref vxVerifyGraph</tt> would return. After
+ * the graph verfies successfully then processing occurs. If the graph was
+ * previously verified via <tt>\ref vxVerifyGraph</tt> or <tt>\ref vxProcessGraph</tt>
+ * then the graph is processed. This function blocks until the graph is completed.
+ * \param [in] graph The graph to execute.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Graph has been processed; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \retval VX_FAILURE A catastrophic error occurred during processing.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxProcessGraph(vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxProcessSubGraph(vx_graph graph, int start_blk_idx, int blk_count);
+
+
+/*! \brief Allows the user to query attributes of the Graph.
+ * \param [in] graph The reference to the created graph.
+ * \param [in] attribute The <tt>\ref vx_graph_attribute_e</tt> type needed.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryGraph(vx_graph graph, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows the attributes of the Graph to be set to the provided value.
+ * \param [in] graph The reference to the graph.
+ * \param [in] attribute The <tt>\ref vx_graph_attribute_e</tt> type needed.
+ * \param [in] ptr The location from which to read the value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphAttribute(vx_graph graph, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Adds the given parameter extracted from a <tt>\ref vx_node</tt> to the graph.
+ * \param [in] graph The graph reference that contains the node.
+ * \param [in] parameter The parameter reference to add to the graph from the node.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Parameter added to Graph; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference or parameter is not a valid <tt>\ref vx_parameter</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS The parameter is of a node not in this
+ * graph.
+ * \ingroup group_graph_parameters
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAddParameterToGraph(vx_graph graph, vx_parameter parameter);
+
+/*! \brief Sets a reference to the parameter on the graph. The implementation
+ * must set this parameter on the originating node as well.
+ * \param [in] graph The graph reference.
+ * \param [in] index The parameter index.
+ * \param [in] value The reference to set to the parameter.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Parameter set to Graph; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference or
+ * value is not a valid <tt>\ref vx_reference</tt>.
+ * \retval VX_ERROR_INVALID_PARAMETERS The parameter index is out of bounds or the
+ * dir parameter is incorrect.
+ * \ingroup group_graph_parameters
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphParameterByIndex(vx_graph graph, vx_uint32 index, vx_reference value);
+
+/*! \brief Retrieves a <tt>\ref vx_parameter</tt> from a <tt>\ref vx_graph</tt>.
+ * \param [in] graph The graph.
+ * \param [in] index The index of the parameter.
+ * \return <tt>\ref vx_parameter</tt> reference. Any possible errors preventing a successful
+ * function completion should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_graph_parameters
+ */
+VX_API_ENTRY vx_parameter VX_API_CALL vxGetGraphParameterByIndex(vx_graph graph, vx_uint32 index);
+
+/*! \brief Returns a Boolean to indicate the state of graph verification.
+ * \param [in] graph The reference to the graph to check.
+ * \return A <tt>\ref vx_bool</tt> value.
+ * \retval vx_true_e The graph is verified.
+ * \retval vx_false_e The graph is not verified. It must be verified before
+ * execution either through <tt>\ref vxVerifyGraph</tt> or automatically through
+ * <tt>\ref vxProcessGraph</tt> or <tt>\ref vxScheduleGraph</tt>.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_bool VX_API_CALL vxIsGraphVerified(vx_graph graph);
+
+/*==============================================================================
+ NODE
+ =============================================================================*/
+
+/*! \brief Creates a reference to a node object for a given kernel.
+ * \details This node has no references assigned as parameters after completion.
+ * The client is then required to set these parameters manually by <tt>\ref vxSetParameterByIndex</tt>.
+ * When clients supply their own node creation functions (for use with User Kernels), this is the API
+ * to use along with the parameter setting API.
+ * \param [in] graph The reference to the graph in which this node exists.
+ * \param [in] kernel The kernel reference to associate with this new node.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \note A call to this API sets all parameters to NULL.
+ * \ingroup group_adv_node
+ * \post Call <tt>\ref vxSetParameterByIndex</tt> for as many parameters as needed to be set.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxCreateGenericNode(vx_graph graph, vx_kernel kernel);
+
+/*! \brief Allows a user to query information out of a node.
+ * \param [in] node The reference to the node to query.
+ * \param [in] attribute Use <tt>\ref vx_node_attribute_e</tt> value to query for information.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytesin bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS The type or size is incorrect.
+ * \ingroup group_node
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryNode(vx_node node, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows a user to set attribute of a node before Graph Validation.
+ * \param [in] node The reference to the node to set.
+ * \param [in] attribute Use <tt>\ref vx_node_attribute_e</tt> value to set the desired attribute.
+ * \param [in] ptr The pointer to the desired value of the attribute.
+ * \param [in] size The size in bytes of the objects to which \a ptr points.
+ * \note Some attributes are inherited from the <tt>\ref vx_kernel</tt>, which was used
+ * to create the node. Some of these can be overridden using this API, notably
+ * \ref VX_NODE_LOCAL_DATA_SIZE and \ref VX_NODE_LOCAL_DATA_PTR.
+ * \ingroup group_node
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS The attribute was set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS size is not correct for the type needed.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetNodeAttribute(vx_node node, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Releases a reference to a Node object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] node The pointer to the reference of the node to release.
+ * \ingroup group_node
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseNode(vx_node *node);
+
+/*! \brief Removes a Node from its parent Graph and releases it.
+ * \param [in] node The pointer to the node to remove and release.
+ * \ingroup group_node
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxRemoveNode(vx_node *node);
+
+/*! \brief Assigns a callback to a node.
+ * If a callback already exists in this node, this function must return an error
+ * and the user may clear the callback by passing a NULL pointer as the callback.
+ * \param [in] node The reference to the node.
+ * \param [in] callback The callback to associate with completion of this
+ * specific node.
+ * \warning This must be used with <b><i>extreme</i></b> caution as it can \e ruin
+ * optimizations in the power/performance efficiency of a graph.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Callback assigned; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ * \ingroup group_node_callback
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAssignNodeCallback(vx_node node, vx_nodecomplete_f callback);
+
+/*! \brief Retrieves the current node callback function pointer set on the node.
+ * \param [in] node The reference to the <tt>\ref vx_node</tt> object.
+ * \ingroup group_node_callback
+ * \return vx_nodecomplete_f The pointer to the callback function.
+ * \retval NULL No callback is set.
+ * \retval * The node callback function.
+ */
+VX_API_ENTRY vx_nodecomplete_f VX_API_CALL vxRetrieveNodeCallback(vx_node node);
+
+/*! \brief Sets the node target to the provided value. A success invalidates the graph
+ * that the node belongs to (<tt>\ref vxVerifyGraph</tt> must be called before the next execution)
+ * \param [in] node  The reference to the <tt>\ref vx_node</tt> object.
+ * \param [in] target_enum  The target enum to be set to the <tt>\ref vx_node</tt> object.
+ * Use a <tt>\ref vx_target_e</tt>.
+ * \param [in] target_string  The target name ASCII string. This contains a valid value
+ * when target_enum is set to <tt>\ref VX_TARGET_STRING</tt>, otherwise it is ignored.
+ * \ingroup group_node
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Node target set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED If the node kernel is not supported by the specified target.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetNodeTarget(vx_node node, vx_enum target_enum, const char* target_string);
+
+/*! \brief Creates replicas of the same node first_node to process a set of objects
+ * stored in <tt>\ref vx_pyramid</tt> or <tt>\ref vx_object_array</tt>.
+ * first_node needs to have as parameter levels 0 of a <tt>\ref vx_pyramid</tt> or the index 0 of a <tt>\ref vx_object_array</tt>.
+ * Replica nodes are not accessible by the application through any means. An application request for removal of
+ * first_node from the graph will result in removal of all replicas. Any change of parameter or attribute of
+ * first_node will be propagated to the replicas. <tt>\ref vxVerifyGraph</tt> shall enforce consistency of parameters and attributes
+ * in the replicas.
+ * \param [in] graph The reference to the graph.
+ * \param [in] first_node The reference to the node in the graph that will be replicated.
+ * \param [in] replicate an array of size equal to the number of node parameters, vx_true_e for the parameters
+ * that should be iterated over (should be a reference to a vx_pyramid or a vx_object_array),
+ * vx_false_e for the parameters that should be the same across replicated nodes and for optional
+ * parameters that are not used. Should be vx_true_e for all output and bidirectional parameters.
+ * \param [in] number_of_parameters number of elements in the replicate array
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference, or first_node is not a
+ * valid <tt>\ref vx_node</tt> reference.
+ * \retval VX_ERROR_NOT_COMPATIBLE At least one of replicated parameters is not of level 0 of a pyramid or at index 0 of an object array.
+ * \retval VX_FAILURE If the node does not belong to the graph, or the number of objects in the parent objects of inputs and output are not the same.
+ * \ingroup group_node
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReplicateNode(vx_graph graph, vx_node first_node, vx_bool replicate[], vx_uint32 number_of_parameters);
+
+/*==============================================================================
+ PARAMETER
+ =============================================================================*/
+
+/*! \brief Retrieves a <tt>\ref vx_parameter</tt> from a <tt>\ref vx_node</tt>.
+ * \param [in] node The node from which to extract the parameter.
+ * \param [in] index The index of the parameter to which to get a reference.
+ * \return A parameter reference <tt>\ref vx_parameter</tt>. Any possible errors preventing a successful
+ * completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_parameter
+ */
+VX_API_ENTRY vx_parameter VX_API_CALL vxGetParameterByIndex(vx_node node, vx_uint32 index);
+
+/*! \brief Releases a reference to a parameter object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] param The pointer to the parameter to release.
+ * \ingroup group_parameter
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE param is not a valid <tt>\ref vx_parameter</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseParameter(vx_parameter *param);
+
+/*! \brief Sets the specified parameter data for a kernel on the node.
+ * \param [in] node The node that contains the kernel.
+ * \param [in] index The index of the parameter desired.
+ * \param [in] value The desired value of the parameter.
+ * \note A user may not provide a NULL value for a mandatory parameter of this API.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference, or value
+ * is not a valid <tt>\ref vx_reference</tt> reference.
+ * \ingroup group_parameter
+ * \see vxSetParameterByReference
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetParameterByIndex(vx_node node, vx_uint32 index, vx_reference value);
+
+/*! \brief Associates a parameter reference and a data reference with a kernel
+ * on a node.
+ * \param [in] parameter The reference to the kernel parameter.
+ * \param [in] value The value to associate with the kernel parameter.
+ * \note A user may not provide a NULL value for a mandatory parameter of this API.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE parameter is not a valid <tt>\ref vx_parameter</tt> reference,
+ * or value is not a valid <tt>\ref vx_reference</tt> reference..
+ * \ingroup group_parameter
+ * \see vxGetParameterByIndex
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetParameterByReference(vx_parameter parameter, vx_reference value);
+
+/*! \brief Allows the client to query a parameter to determine its meta-information.
+ * \param [in] parameter The reference to the parameter.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_parameter_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE parameter is not a valid <tt>\ref vx_parameter</tt> reference.
+ * \ingroup group_parameter
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryParameter(vx_parameter parameter, vx_enum attribute, void *ptr, vx_size size);
+
+/*==============================================================================
+ SCALAR
+ =============================================================================*/
+
+/*! \brief Creates a reference to a scalar object. Also see \ref sub_node_parameters.
+ * \param [in] context The reference to the system context.
+ * \param [in] data_type The type of data to hold. Must be greater than
+ * <tt>\ref VX_TYPE_INVALID</tt> and less than or equal to <tt>\ref VX_TYPE_VENDOR_STRUCT_END</tt>.
+ * Or must be a <tt>\ref vx_enum</tt> returned from <tt>\ref vxRegisterUserStruct</tt>.
+ * \param [in] ptr The pointer to the initial value of the scalar.
+ * \ingroup group_scalar
+ * \returns A scalar reference <tt>\ref vx_scalar</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_scalar VX_API_CALL vxCreateScalar(vx_context context, vx_enum data_type, const void *ptr);
+
+/*! \brief Creates a reference to a scalar object. Also see \ref sub_node_parameters.
+ * \param [in] context The reference to the system context.
+ * \param [in] data_type The type of data to hold. Must be greater than
+ * <tt>\ref VX_TYPE_INVALID</tt> and less than or equal to <tt>\ref VX_TYPE_VENDOR_STRUCT_END</tt>.
+ * Or must be a <tt>\ref vx_enum</tt> returned from <tt>\ref vxRegisterUserStruct</tt>.
+ * \param [in] ptr The pointer to the initial value of the scalar.
+ * \param [in] size Size of data at ptr in bytes.
+ * \ingroup group_scalar
+ * \returns A scalar reference <tt>\ref vx_scalar</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_scalar VX_API_CALL vxCreateScalarWithSize(vx_context context, vx_enum data_type, const void *ptr, vx_size size);
+VX_API_ENTRY vx_scalar VX_API_CALL vxCreateGraphScalarWithSize(vx_graph graph, vx_enum data_type, const void* ptr, vx_size size);
+
+/*! \brief Creates an opaque reference to a scalar object with no direct user access.
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] data_type The type of data to hold. Must be greater than
+ * <tt>\ref VX_TYPE_INVALID</tt> and less than or equal to <tt>\ref VX_TYPE_VENDOR_STRUCT_END</tt>.
+ * Or must be a <tt>\ref vx_enum</tt> returned from <tt>\ref vxRegisterUserStruct</tt>.
+ * \see <tt>\ref vxCreateScalar</tt>
+ * \ingroup group_scalar
+ * \returns A scalar reference <tt>\ref vx_scalar</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_scalar VX_API_CALL vxCreateVirtualScalar(vx_graph graph, vx_enum data_type);
+
+/*! \brief Releases a reference to a scalar object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] scalar The pointer to the scalar to release.
+ * \ingroup group_scalar
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE scalar is not a valid <tt>\ref vx_scalar</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseScalar(vx_scalar *scalar);
+
+/*! \brief Queries attributes from a scalar.
+ * \param [in] scalar The scalar object.
+ * \param [in] attribute The enumeration to query. Use a <tt>\ref vx_scalar_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE scalar is not a valid <tt>\ref vx_scalar</tt> reference.
+ * \ingroup group_scalar
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryScalar(vx_scalar scalar, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows the application to copy from/into a scalar object.
+ * \param [in] scalar The reference to the scalar object that is the source or the
+ * destination of the copy.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the
+ * scalar object if the copy was requested in write mode. In the user memory, the scalar is
+ * a variable of the type corresponding to <tt>\ref VX_SCALAR_TYPE</tt>.
+ * The accessible memory must be large enough to contain this variable.
+ * \param [in] usage This declares the effect of the copy with regard to the scalar object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the scalar object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the scalar object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE scalar is not a valid <tt>\ref vx_scalar</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_scalar
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyScalar(vx_scalar scalar, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+/*! \brief Allows the application to copy from/into a scalar object with size.
+ * \param [in] scalar The reference to the scalar object that is the source or the
+ * destination of the copy.
+ * \param [in] size The size in bytes of the container to which \a user_ptr points.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the
+ * scalar object if the copy was requested in write mode. In the user memory, the scalar is
+ * a variable of the type corresponding to <tt>\ref VX_SCALAR_TYPE</tt>.
+ * The accessible memory must be large enough to contain this variable.
+ * \param [in] usage This declares the effect of the copy with regard to the scalar object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the scalar object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the scalar object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_ERROR_INVALID_REFERENCE The scalar reference is not actually a scalar reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_scalar
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyScalarWithSize(vx_scalar scalar, vx_size size, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+/*==============================================================================
+ REFERENCE
+ =============================================================================*/
+
+/*! \brief Queries any reference type for some basic information like count or type.
+ * \param [in] ref The reference to query.
+ * \param [in] attribute The value for which to query. Use <tt>\ref vx_reference_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE ref is not a valid <tt>\ref vx_reference</tt> reference.
+ * \ingroup group_reference
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryReference(vx_reference ref, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Releases a reference. The reference may potentially refer to multiple OpenVX objects of different types.
+ * This function can be used instead of calling a specific release function for each individual object type
+ * (e.g. vxRelease<object>). The object will not be destroyed until its total reference count is zero.
+ * \note After returning from this function the reference is zeroed.
+ * \param [in] ref_ptr The pointer to the reference of the object to release.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE ref_ptr is not a valid <tt>\ref vx_reference</tt> reference.
+ * \ingroup group_reference
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseReference(vx_reference* ref_ptr);
+
+/*!
+ * \brief Increments the reference counter of an object
+ * This function is used to express the fact that the OpenVX object is referenced
+ * multiple times by an application. Each time this function is called for
+ * an object, the application will need to release the object one additional
+ * time before it can be destructed
+ * \param [in] ref The reference to retain.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE ref is not a valid <tt>\ref vx_reference</tt> reference.
+ * \ingroup group_reference
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxRetainReference(vx_reference ref);
+VX_API_ENTRY vx_status VX_API_CALL vxRetainTensor(vx_tensor tensor);
+VX_API_ENTRY vx_status VX_API_CALL vxRetainNode(vx_node node);
+
+/*! \brief Name a reference
+ * \ingroup group_reference
+ *
+ * This function is used to associate a name to a referenced object. This name
+ * can be used by the OpenVX implementation in log messages and any
+ * other reporting mechanisms.
+ *
+ * The OpenVX implementation will not check if the name is unique in
+ * the reference scope (context or graph). Several references can then
+ * have the same name.
+ *
+ * \param [in] ref The reference to the object to be named.
+ * \param [in] name Pointer to the '\0' terminated string that identifies
+ *             the referenced object.
+ *             The string is copied by the function so that it
+ *             stays the property of the caller.
+ *             NULL means that the reference is not named.
+ *             The length of the string shall be lower than VX_MAX_REFERENCE_NAME bytes.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE ref is not a valid <tt>\ref vx_reference</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetReferenceName(vx_reference ref, const vx_char *name);
+
+/*==============================================================================
+ DELAY
+ =============================================================================*/
+
+/*! \brief Queries a <tt>\ref vx_delay</tt> object attribute.
+ * \param [in] delay The reference to a delay object.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_delay_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE delay is not a valid <tt>\ref vx_delay</tt> reference.
+ * \ingroup group_delay
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryDelay(vx_delay delay, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Releases a reference to a delay object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] delay The pointer to the delay object reference to release.
+ * \post After returning from this function the reference is zeroed.
+ * \ingroup group_delay
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE delay is not a valid <tt>\ref vx_delay</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseDelay(vx_delay *delay);
+
+
+/*! \brief Creates a Delay object.
+ * \details This function creates a delay object with \p num_slots slots. Each slot
+ * contains a clone of the exemplar. The clones only inherit the metadata of the
+ * exemplar. The data content of the exemplar is ignored and the clones have their
+ * data undefined at delay creation time.
+ * The function does not alter the exemplar. Also, it doesn't retain or release the
+ * reference to the exemplar.
+ * \note For the definition of metadata attributes see \ref vxSetMetaFormatAttribute.
+ * \param [in] context The reference to the context.
+ * \param [in] exemplar The exemplar object. Supported exemplar object types are:<br>
+ * \arg \ref VX_TYPE_ARRAY
+ * \arg \ref VX_TYPE_CONVOLUTION
+ * \arg \ref VX_TYPE_DISTRIBUTION
+ * \arg \ref VX_TYPE_IMAGE
+ * \arg \ref VX_TYPE_LUT
+ * \arg \ref VX_TYPE_MATRIX
+ * \arg \ref VX_TYPE_OBJECT_ARRAY
+ * \arg \ref VX_TYPE_PYRAMID
+ * \arg \ref VX_TYPE_REMAP
+ * \arg \ref VX_TYPE_SCALAR
+ * \arg \ref VX_TYPE_THRESHOLD
+ * \arg \ref VX_TYPE_TENSOR
+ * \param [in] num_slots The number of objects in the delay. This value must be greater than zero.
+ * \returns A delay reference <tt>\ref vx_delay</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_delay
+ */
+VX_API_ENTRY vx_delay VX_API_CALL vxCreateDelay(vx_context context,
+                              vx_reference exemplar,
+                              vx_size num_slots);
+
+/*! \brief Retrieves a reference to a delay slot object.
+ * \param [in] delay The reference to the delay object.
+ * \param [in] index The index of the delay slot from which to extract the object reference.
+ * \return <tt>\ref vx_reference</tt>. Any possible errors preventing a successful
+ * completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \note The delay index is in the range \f$ [-count+1,0] \f$. 0 is always the
+ * \e current object.
+ * \ingroup group_delay
+ * \note A reference retrieved with this function must not be given to its associated
+ * release API (e.g. <tt>\ref vxReleaseImage</tt>) unless <tt>\ref vxRetainReference</tt> is used.
+ */
+VX_API_ENTRY vx_reference VX_API_CALL vxGetReferenceFromDelay(vx_delay delay, vx_int32 index);
+
+/*! \brief Shifts the internal delay ring by one.
+ *
+ * This function performs a shift of the internal delay ring by one. This means that,
+ * the data originally at index 0 move to index -1 and so forth until index
+ * \f$ -count+1 \f$. The data originally at index \f$ -count+1 \f$ move to index 0.
+ * Here \f$ count \f$ is the number of slots in delay ring.
+ * When a delay is aged, any graph making use of this delay (delay object itself or data
+ * objects in delay slots) gets its data automatically updated accordingly.
+ * \param [in] delay
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Delay was aged; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE delay is not a valid <tt>\ref vx_delay</tt> reference.
+ * \ingroup group_delay
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAgeDelay(vx_delay delay);
+
+/*! \brief Register a delay for auto-aging.
+ *
+ * This function registers a delay object to be auto-aged by the graph.
+ * This delay object will be automatically aged after each successful completion of
+ * this graph. Aging of a delay object cannot be called during graph execution.
+ * A graph abandoned due to a node callback will trigger an auto-aging.
+ *
+ * If a delay is registered for auto-aging multiple times in a same graph,
+ * the delay will be only aged a single time at each graph completion.
+ * If a delay is registered for auto-aging in multiple graphs, this delay will
+ * aged automatically after each successful completion of any of these graphs.
+ *
+ * \param [in] graph The graph to which the delay is registered for auto-aging.
+ * \param [in] delay The delay to automatically age.
+ *
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference, or
+ * delay is not a valid <tt>\ref vx_delay</tt> reference.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxRegisterAutoAging(vx_graph graph, vx_delay delay);
+
+/*==============================================================================
+ META FORMAT
+ =============================================================================*/
+
+/*! \brief This function allows a user to set the attributes of a <tt>\ref vx_meta_format</tt> object in a kernel output validator.
+ *
+ * The \ref vx_meta_format object contains two types of information: data object meta data and
+ * some specific information that defines how the valid region of an image changes
+ *
+ * The meta data attributes that can be set are identified by this list:
+ * - \ref vx_image : \ref VX_IMAGE_FORMAT, \ref VX_IMAGE_HEIGHT, \ref VX_IMAGE_WIDTH
+ * - \ref vx_array : \ref VX_ARRAY_CAPACITY, \ref VX_ARRAY_ITEMTYPE
+ * - \ref vx_pyramid : \ref VX_PYRAMID_FORMAT, \ref VX_PYRAMID_HEIGHT, \ref VX_PYRAMID_WIDTH, \ref VX_PYRAMID_LEVELS, \ref VX_PYRAMID_SCALE
+ * - \ref vx_scalar : \ref VX_SCALAR_TYPE
+ * - \ref vx_matrix : \ref VX_MATRIX_TYPE, \ref VX_MATRIX_ROWS, \ref VX_MATRIX_COLUMNS
+ * - \ref vx_distribution : \ref VX_DISTRIBUTION_BINS, \ref VX_DISTRIBUTION_OFFSET, \ref VX_DISTRIBUTION_RANGE
+ * - \ref vx_remap : \ref VX_REMAP_SOURCE_WIDTH, \ref VX_REMAP_SOURCE_HEIGHT, \ref VX_REMAP_DESTINATION_WIDTH, \ref VX_REMAP_DESTINATION_HEIGHT
+ * - \ref vx_lut : \ref VX_LUT_TYPE, \ref VX_LUT_COUNT
+ * - \ref vx_threshold : \ref VX_THRESHOLD_TYPE, \ref VX_THRESHOLD_INPUT_FORMAT, \ref VX_THRESHOLD_INPUT_FORMAT
+ * - \ref vx_object_array : \ref VX_OBJECT_ARRAY_NUMITEMS, \ref VX_OBJECT_ARRAY_ITEMTYPE
+ * - \ref vx_tensor : \ref VX_TENSOR_NUMBER_OF_DIMS, \ref VX_TENSOR_DIMS, \ref VX_TENSOR_DATA_TYPE, \ref VX_TENSOR_FIXED_POINT_POSITION
+ * - \ref VX_VALID_RECT_CALLBACK
+ * \note For vx_image, a specific attribute can be used to specify the valid region evolution. This information is not a meta data.
+ *
+ * \param [in] meta The reference to the \ref vx_meta_format struct to set
+ * \param [in] attribute Use the subset of data object attributes that define the meta data of this object or attributes from <tt>\ref vx_meta_format</tt>.
+ * \param [in] ptr The input pointer of the value to set on the meta format object.
+ * \param [in] size The size in bytes of the object to which \a ptr points.
+ * \ingroup group_user_kernels
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS The attribute was set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE meta is not a valid <tt>\ref vx_meta_format</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS size was not correct for the type needed.
+ * \retval VX_ERROR_NOT_SUPPORTED the object attribute was not supported on the meta format object.
+ * \retval VX_ERROR_INVALID_TYPE attribute type did not match known meta format type.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetMetaFormatAttribute(vx_meta_format meta, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Set a meta format object from an exemplar data object reference
+ *
+ * This function sets a \ref vx_meta_format object from the meta data of the exemplar
+ *
+ * \param [in] meta The meta format object to set
+ * \param [in] exemplar The exemplar data object.
+ * \ingroup group_user_kernels
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS The meta format was correctly set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE meta is not a valid <tt>\ref vx_meta_format</tt> reference,
+ * or exemplar is not a valid <tt>\ref vx_reference</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetMetaFormatFromReference(vx_meta_format meta, vx_reference exemplar);
+/*==============================================================================
+    TENSOR DATA FUNCTIONS
+=============================================================================*/
+/*! \brief Creates an opaque reference to a tensor data buffer.
+ * \details Not guaranteed to exist until the <tt>\ref vx_graph</tt> containing it has been verified.
+ * Since functions using tensors, need to understand the context of each dimension. We describe a layout of the dimensions in each function using tensors.
+ * That layout is not mandatory. It is done specifically to explain the functions and not to mandate layout. Different implementation may have different layout.
+ * Therefore the layout description is logical and not physical. It refers to the order of dimensions given in this function.
+ * \param [in] context The reference to the implementation context.
+ * \param [in] number_of_dims The number of dimensions.
+ * \param [in] dims Dimensions sizes in elements.
+ * \param [in] data_type The <tt>\ref vx_type_e</tt> that represents the data type of the tensor data elements. 
+ * \param [in] fixed_point_position Specifies the fixed point position when the input element type is integer. if 0, calculations are performed in integer math.
+ * \return A tensor data reference. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_tensor VX_API_CALL vxCreateTensor(vx_context context, vx_size number_of_dims, const vx_size * dims, vx_enum data_type,vx_int8 fixed_point_position);
+
+/*! \brief Creates a tensor data from another tensor data given a view. This second
+ * reference refers to the data in the original tensor data. Updates to this tensor data
+ * updates the parent tensor data. The view must be defined within the dimensions
+ * of the parent tensor data.
+ * \param [in] tensor The reference to the parent tensor data.
+ * \param [in] number_of_dims Number of dimensions in the view. Error return if 0 or greater than number of
+ * tensor dimensions. If smaller than number of tensor dimensions, the lower dimensions are assumed.
+ * \param [in] view_start View start coordinates
+ * \param [in] view_end View end coordinates
+ * \return The reference to the sub-tensor. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_tensor VX_API_CALL vxCreateTensorFromView(vx_tensor tensor, vx_size number_of_dims, const vx_size * view_start, const vx_size * view_end);
+
+/*! \brief Retrieves various attributes of a tensor data.
+ * \param [in] tensor The reference to the tensor data to query.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_tensor_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_ERROR_INVALID_REFERENCE If data is not a <tt>\ref vx_tensor</tt>.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryTensor(vx_tensor tensor, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Releases a reference to a tensor data object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] tensor The pointer to the tensor data to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; all other values indicate failure
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseTensor(vx_tensor *tensor);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif

+ 178 - 0
include/VX/vx_compatibility.h

@@ -0,0 +1,178 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef VX_1_0_1_NAMING_COMPATIBILITY
+#define VX_1_0_1_NAMING_COMPATIBILITY
+
+#define VX_TYPE_SCALAR_MAX         (VX_TYPE_BOOL + 1)
+
+#define vx_border_mode_e           vx_border_e
+#define vx_border_mode_policy_e    vx_border_policy_e
+#define _vx_border_mode_t          _vx_border_t
+#define vx_border_mode_t           vx_border_t
+
+#define VX_REF_ATTRIBUTE_COUNT VX_REFERENCE_COUNT
+#define VX_REF_ATTRIBUTE_TYPE  VX_REFERENCE_TYPE
+#define VX_REF_ATTRIBUTE_NAME  VX_REFERENCE_NAME
+
+#define VX_CONTEXT_ATTRIBUTE_VENDOR_ID                          VX_CONTEXT_VENDOR_ID
+#define VX_CONTEXT_ATTRIBUTE_VERSION                            VX_CONTEXT_VERSION
+#define VX_CONTEXT_ATTRIBUTE_UNIQUE_KERNELS                     VX_CONTEXT_UNIQUE_KERNELS
+#define VX_CONTEXT_ATTRIBUTE_MODULES                            VX_CONTEXT_MODULES
+#define VX_CONTEXT_ATTRIBUTE_REFERENCES                         VX_CONTEXT_REFERENCES
+#define VX_CONTEXT_ATTRIBUTE_IMPLEMENTATION                     VX_CONTEXT_IMPLEMENTATION
+#define VX_CONTEXT_ATTRIBUTE_EXTENSIONS_SIZE                    VX_CONTEXT_EXTENSIONS_SIZE
+#define VX_CONTEXT_ATTRIBUTE_EXTENSIONS                         VX_CONTEXT_EXTENSIONS
+#define VX_CONTEXT_ATTRIBUTE_CONVOLUTION_MAXIMUM_DIMENSION      VX_CONTEXT_CONVOLUTION_MAX_DIMENSION
+#define VX_CONTEXT_ATTRIBUTE_UNIQUE_KERNEL_TABLE                VX_CONTEXT_UNIQUE_KERNEL_TABLE
+
+#define VX_KERNEL_ATTRIBUTE_PARAMETERS      VX_KERNEL_PARAMETERS
+#define VX_KERNEL_ATTRIBUTE_NAME            VX_KERNEL_NAME
+#define VX_KERNEL_ATTRIBUTE_ENUM            VX_KERNEL_ENUM
+
+#define VX_NODE_ATTRIBUTE_STATUS            VX_NODE_STATUS
+#define VX_NODE_ATTRIBUTE_PERFORMANCE       VX_NODE_PERFORMANCE
+#define VX_NODE_ATTRIBUTE_BORDER_MODE       VX_NODE_BORDER
+
+#define VX_PARAMETER_ATTRIBUTE_INDEX        VX_PARAMETER_INDEX
+#define VX_PARAMETER_ATTRIBUTE_DIRECTION    VX_PARAMETER_DIRECTION
+#define VX_PARAMETER_ATTRIBUTE_TYPE         VX_PARAMETER_TYPE
+#define VX_PARAMETER_ATTRIBUTE_STATE        VX_PARAMETER_STATE
+#define VX_PARAMETER_ATTRIBUTE_REF          VX_PARAMETER_REF
+
+#define VX_IMAGE_ATTRIBUTE_WIDTH            VX_IMAGE_WIDTH
+#define VX_IMAGE_ATTRIBUTE_HEIGHT           VX_IMAGE_HEIGHT
+#define VX_IMAGE_ATTRIBUTE_FORMAT           VX_IMAGE_FORMAT
+#define VX_IMAGE_ATTRIBUTE_PLANES           VX_IMAGE_PLANES
+#define VX_IMAGE_ATTRIBUTE_SPACE            VX_IMAGE_SPACE
+#define VX_IMAGE_ATTRIBUTE_RANGE            VX_IMAGE_RANGE
+#define VX_IMAGE_ATTRIBUTE_SIZE             VX_IMAGE_SIZE
+
+#define VX_SCALAR_ATTRIBUTE_TYPE            VX_SCALAR_TYPE
+
+#define VX_GRAPH_ATTRIBUTE_NUMNODES         VX_GRAPH_NUMNODES
+#define VX_GRAPH_ATTRIBUTE_STATUS           (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x1)
+#define VX_GRAPH_ATTRIBUTE_NUMPARAMETERS    VX_GRAPH_NUMPARAMETERS
+
+#define VX_LUT_ATTRIBUTE_TYPE               VX_LUT_TYPE
+#define VX_LUT_ATTRIBUTE_COUNT              VX_LUT_COUNT
+#define VX_LUT_ATTRIBUTE_SIZE               VX_LUT_SIZE
+
+#define VX_DISTRIBUTION_ATTRIBUTE_DIMENSIONS    VX_DISTRIBUTION_DIMENSIONS
+#define VX_DISTRIBUTION_ATTRIBUTE_OFFSET        VX_DISTRIBUTION_OFFSET
+#define VX_DISTRIBUTION_ATTRIBUTE_RANGE         VX_DISTRIBUTION_RANGE
+#define VX_DISTRIBUTION_ATTRIBUTE_BINS          VX_DISTRIBUTION_BINS
+#define VX_DISTRIBUTION_ATTRIBUTE_WINDOW        VX_DISTRIBUTION_WINDOW
+#define VX_DISTRIBUTION_ATTRIBUTE_SIZE          VX_DISTRIBUTION_SIZE
+
+#define VX_THRESHOLD_ATTRIBUTE_TYPE             VX_THRESHOLD_TYPE
+#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_VALUE  VX_THRESHOLD_THRESHOLD_VALUE
+#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_LOWER  VX_THRESHOLD_THRESHOLD_LOWER
+#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_UPPER  VX_THRESHOLD_THRESHOLD_UPPER
+#define VX_THRESHOLD_ATTRIBUTE_TRUE_VALUE       VX_THRESHOLD_TRUE_VALUE
+#define VX_THRESHOLD_ATTRIBUTE_FALSE_VALUE      VX_THRESHOLD_FALSE_VALUE
+#define VX_THRESHOLD_ATTRIBUTE_DATA_TYPE        VX_THRESHOLD_DATA_TYPE
+
+#define VX_MATRIX_ATTRIBUTE_TYPE            VX_MATRIX_TYPE
+#define VX_MATRIX_ATTRIBUTE_ROWS            VX_MATRIX_ROWS
+#define VX_MATRIX_ATTRIBUTE_COLUMNS         VX_MATRIX_COLUMNS
+#define VX_MATRIX_ATTRIBUTE_SIZE            VX_MATRIX_SIZE
+
+#define VX_CONVOLUTION_ATTRIBUTE_ROWS       VX_CONVOLUTION_ROWS
+#define VX_CONVOLUTION_ATTRIBUTE_COLUMNS    VX_CONVOLUTION_COLUMNS
+#define VX_CONVOLUTION_ATTRIBUTE_SCALE      VX_CONVOLUTION_SCALE
+#define VX_CONVOLUTION_ATTRIBUTE_SIZE       VX_CONVOLUTION_SIZE
+
+#define VX_PYRAMID_ATTRIBUTE_LEVELS         VX_PYRAMID_LEVELS
+#define VX_PYRAMID_ATTRIBUTE_SCALE          VX_PYRAMID_SCALE
+#define VX_PYRAMID_ATTRIBUTE_WIDTH          VX_PYRAMID_WIDTH
+#define VX_PYRAMID_ATTRIBUTE_HEIGHT         VX_PYRAMID_HEIGHT
+#define VX_PYRAMID_ATTRIBUTE_FORMAT         VX_PYRAMID_FORMAT
+
+#define VX_REMAP_ATTRIBUTE_SOURCE_WIDTH         VX_REMAP_SOURCE_WIDTH
+#define VX_REMAP_ATTRIBUTE_SOURCE_HEIGHT        VX_REMAP_SOURCE_HEIGHT
+#define VX_REMAP_ATTRIBUTE_DESTINATION_WIDTH    VX_REMAP_DESTINATION_WIDTH
+#define VX_REMAP_ATTRIBUTE_DESTINATION_HEIGHT   VX_REMAP_DESTINATION_HEIGHT
+
+#define VX_ARRAY_ATTRIBUTE_ITEMTYPE         VX_ARRAY_ITEMTYPE
+#define VX_ARRAY_ATTRIBUTE_NUMITEMS         VX_ARRAY_NUMITEMS
+#define VX_ARRAY_ATTRIBUTE_CAPACITY         VX_ARRAY_CAPACITY
+#define VX_ARRAY_ATTRIBUTE_ITEMSIZE         VX_ARRAY_ITEMSIZE
+
+#define VX_DELAY_ATTRIBUTE_TYPE             VX_DELAY_TYPE
+#define VX_DELAY_ATTRIBUTE_SLOTS            VX_DELAY_SLOTS
+
+#define VX_INTERPOLATION_TYPE_AREA                  VX_INTERPOLATION_AREA
+#define VX_INTERPOLATION_TYPE_BILINEAR              VX_INTERPOLATION_BILINEAR
+#define VX_INTERPOLATION_TYPE_NEAREST_NEIGHBOR      VX_INTERPOLATION_NEAREST_NEIGHBOR
+
+#define VX_IMAGE_SIZE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x6)
+
+#define VX_META_FORMAT_ATTRIBUTE_DELTA_RECTANGLE  (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_META_FORMAT) + 0x0)
+#define VX_HINT_SERIALIZE (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_HINT) + 0x0)
+
+#define vx_import_type_e        vx_memory_type_e
+#define VX_ENUM_IMPORT_MEM      VX_ENUM_MEMORY_TYPE
+#define VX_IMPORT_TYPE_NONE     VX_MEMORY_TYPE_NONE
+#define VX_IMPORT_TYPE_HOST     VX_MEMORY_TYPE_HOST
+
+#define VX_TYPE_OBJECT_MAX      VX_TYPE_KHRONOS_OBJECT_END
+#define VX_TYPE_STRUCT_MAX      VX_TYPE_KHRONOS_STRUCT_MAX
+
+#define VX_KERNEL_INVALID (VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x0)
+
+#define VX_THRESHOLD_THRESHOLD_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x1)
+#define VX_THRESHOLD_THRESHOLD_LOWER (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x2)
+#define VX_THRESHOLD_THRESHOLD_UPPER (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x3)
+#define VX_THRESHOLD_TRUE_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x4)
+#define VX_THRESHOLD_FALSE_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x5)
+#define VX_THRESHOLD_DATA_TYPE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x6)
+
+typedef vx_status(VX_CALLBACK *vx_kernel_input_validate_f)(vx_node node, vx_uint32 index);
+
+typedef vx_status(VX_CALLBACK *vx_kernel_output_validate_f)(vx_node node, vx_uint32 index, vx_meta_format meta);
+
+typedef struct _vx_delta_rectangle_t {
+    vx_int32 delta_start_x; /*!< \brief The change in the start x. */
+    vx_int32 delta_start_y; /*!< \brief The change in the start y. */
+    vx_int32 delta_end_x;   /*!< \brief The change in the end x. */
+    vx_int32 delta_end_y;   /*!< \brief The change in the end y. */
+} vx_delta_rectangle_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+VX_API_ENTRY vx_kernel VX_API_CALL vxAddKernel(vx_context context,
+                             const vx_char name[VX_MAX_KERNEL_NAME],
+                             vx_enum enumeration,
+                             vx_kernel_f func_ptr,
+                             vx_uint32 numParams,
+                             vx_kernel_input_validate_f input,
+                             vx_kernel_output_validate_f output,
+                             vx_kernel_initialize_f init,
+                             vx_kernel_deinitialize_f deinit);
+
+VX_API_ENTRY vx_status VX_API_CALL vxReadScalarValue(vx_scalar ref, void *ptr);
+
+VX_API_ENTRY vx_status VX_API_CALL vxWriteScalarValue(vx_scalar ref, const void *ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* VX_1_0_1_NAMING_COMPATIBILITY */

+ 90 - 0
include/VX/vx_kernels.h

@@ -0,0 +1,90 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_KERNELS_H_
+#define _OPENVX_KERNELS_H_
+
+/*!
+ * \file
+ * \brief The list of supported kernels in the OpenVX standard.
+ */
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/*!
+ * \brief The standard list of available libraries
+ * \ingroup group_kernel
+ */
+enum vx_library_e {
+    /*! \brief The base set of kernels as defined by Khronos. */
+    VX_LIBRARY_KHR_BASE = 0x0,
+};
+
+/*!
+ * \brief The standard list of available vision kernels.
+ *
+ * Each kernel listed here can be used with the <tt>\ref vxGetKernelByEnum</tt> call.
+ * When programming the parameters, use
+ * \arg <tt>\ref VX_INPUT</tt> for [in]
+ * \arg <tt>\ref VX_OUTPUT</tt> for [out]
+ * \arg <tt>\ref VX_BIDIRECTIONAL</tt> for [in,out]
+ *
+ * When programming the parameters, use
+ * \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.
+ * \ingroup group_kernel
+ */
+enum vx_kernel_e {
+            
+    /*! \brief The tensor multiply Kernel.
+    * \see group_vision_function_tensor_multiply
+    */
+    VX_KERNEL_TENSOR_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x30,
+
+    /*! \brief The tensor add Kernel.
+    * \see group_vision_function_tensor_add
+    */
+    VX_KERNEL_TENSOR_ADD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x31,
+
+    /*! \brief The tensor subtract Kernel.
+    * \see group_vision_function_tensor_subtract
+    */
+    VX_KERNEL_TENSOR_SUBTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x32,
+
+    /*! \brief The tensor table look up Kernel.
+    * \see group_vision_function_tensor_tablelookup
+    */
+    VX_KERNEL_TENSOR_TABLE_LOOKUP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x33,
+           
+    /*! \brief The tensor matrix multiply Kernel.
+    * \see group_vision_function_tensor_matrix_multiply
+    */
+    VX_KERNEL_TENSOR_MATRIX_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x36,
+
+    /*! \brief The data object copy kernel.
+    * \see group_vision_function_copy
+    */
+    VX_KERNEL_COPY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x37,
+        
+};
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif  /* _OPEN_VISION_LIBRARY_KERNELS_H_ */

+ 80 - 0
include/VX/vx_khr_icd.h

@@ -0,0 +1,80 @@
+/*
+
+ * Copyright (c) 2017-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*! \file
+ * \defgroup group_icd OpenVX ICD Loader API
+ * \brief The OpenVX Installable Client Driver (ICD) Loader API.
+ * \details The vx_khr_icd extension provides a mechanism for vendors to implement Installable Client Driver (ICD) for OpenVX. The OpenVX ICD Loader API provides a mechanism for applications to access these vendor implementations.
+ */
+
+#ifndef _VX_KHR_ICD_H_
+#define _VX_KHR_ICD_H_
+
+#include <VX/vx.h>
+#include <VX/vxu.h>
+
+/*! \brief Platform handle of an implementation.
+ *  \ingroup group_icd
+ */
+typedef struct _vx_platform * vx_platform;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief Queries list of available platforms.
+ * \param [in] capacity Maximum number of items that platform[] can hold.
+ * \param [out] platform[] List of platform handles.
+ * \param [out] pNumItems Number of platform handles returned.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_FAILURE If no platforms are found.
+ * \ingroup group_icd
+ */
+vx_status VX_API_CALL vxIcdGetPlatforms(vx_size capacity, vx_platform platform[], vx_size * pNumItems);
+
+/*! \brief Queries the platform for some specific information.
+ * \param [in] platform The platform handle.
+ * \param [in] attribute The attribute to query. Use one of the following:
+ *               <tt>\ref VX_CONTEXT_VENDOR_ID</tt>,
+ *               <tt>\ref VX_CONTEXT_VERSION</tt>,
+ *               <tt>\ref VX_CONTEXT_EXTENSIONS_SIZE</tt>,
+ *               <tt>\ref VX_CONTEXT_EXTENSIONS</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_ERROR_INVALID_REFERENCE If the platform is not a <tt>\ref vx_platform</tt>.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not supported on this implementation.
+ * \ingroup group_icd
+ */
+vx_status VX_API_CALL vxQueryPlatform(vx_platform platform, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Creates a <tt>\ref vx_context</tt> from a <tt>\ref vx_platform</tt>.
+ * \details This creates a top-level object context for OpenVX from a platform handle.
+ * \returns The reference to the implementation context <tt>\ref vx_context</tt>. Any possible errors
+ * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_icd
+ */
+vx_context VX_API_CALL vxCreateContextFromPlatform(vx_platform platform);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 394 - 0
include/VX/vx_khr_nn.h

@@ -0,0 +1,394 @@
+/* 
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _VX_KHR_NN_H_
+#define _VX_KHR_NN_H_
+
+/*!
+ * \file
+ * \brief The Khronos Extension for Deep Convolutional Networks Functions.
+ *
+ * \defgroup group_cnn Extension: Deep Convolutional Networks API
+ * \brief Convolutional Network Nodes.
+ */
+
+#define OPENVX_KHR_NN   "vx_khr_nn"
+
+#include <vector>
+#include <VX/vx.h>
+
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+
+/*==============================================================================
+CONVOLUTIONAL_NETWORK structs and enums
+=============================================================================*/
+
+/*! \brief The Neural Network Extension Library Set
+ * \ingroup group_cnn
+ */
+#define VX_LIBRARY_KHR_NN_EXTENSION (0x1) 
+
+/*! \brief The list of Neural Network Extension Kernels.
+ * \ingroup group_cnn
+ */
+enum vx_kernel_nn_ext_e {
+    /*! \brief The Neural Network Extension convolution Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_CONVOLUTION_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x0,
+    /*! \brief The Neural Network Extension fully connected Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_FULLY_CONNECTED_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x1,
+    /*! \brief The Neural Network Extension pooling Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_POOLING_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x2,
+    /*! \brief The Neural Network Extension softmax Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_SOFTMAX_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x3,
+    /*! \brief The Neural Network Extension normalization Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_NORMALIZATION_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x4,
+    /*! \brief The Neural Network Extension activation Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_ACTIVATION_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x5,
+    /*! \brief The Neural Network POI Pooling Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_ROI_POOLING_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x6,
+    /*! \brief The Neural Network Extension Deconvolution Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_DECONVOLUTION_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x7,
+};
+
+/*! \brief NN extension type enums.
+ * \ingroup group_cnn
+ */
+enum vx_nn_enum_e
+{
+    VX_ENUM_NN_ROUNDING_TYPE	= 0x1A,
+    VX_ENUM_NN_POOLING_TYPE	= 0x1B,
+    VX_ENUM_NN_NORMALIZATION_TYPE	= 0x1C,
+    VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE	= 0x1D,
+};
+
+/*! \brief down scale rounding.
+ * \details Due to different scheme of downscale size calculation in the various training frameworks. Implementation must support 2 rounding methods for down scale calculation.
+ * The floor and the ceiling. In convolution and pooling functions.
+ * Relevant when input size is even.
+ * \ingroup group_cnn
+ */
+enum vx_nn_rounding_type_e
+{
+    /*! \brief floor rounding  */
+    VX_NN_DS_SIZE_ROUNDING_FLOOR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ROUNDING_TYPE) + 0x0,
+    /*! \brief ceil rounding */
+    VX_NN_DS_SIZE_ROUNDING_CEILING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ROUNDING_TYPE) + 0x1
+};
+
+
+/*! \brief The Neural Network pooling type list.
+ * \details kind of pooling done in pooling function
+ * \ingroup group_cnn
+ */
+enum vx_nn_pooling_type_e
+{
+    /*! \brief max pooling*/
+    VX_NN_POOLING_MAX = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_POOLING_TYPE) + 0x0,
+    /*! \brief average pooling*/
+    VX_NN_POOLING_AVG = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_POOLING_TYPE) + 0x1
+};
+
+
+/*! \brief The Neural Network normalization type list.
+ * \ingroup group_cnn
+ */
+enum vx_nn_norm_type_e
+{
+    /*! \brief normalization is done on same IFM*/
+    VX_NN_NORMALIZATION_SAME_MAP = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_NORMALIZATION_TYPE) + 0x0,
+    /*! \brief Normalization is done across different IFMs*/
+    VX_NN_NORMALIZATION_ACROSS_MAPS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_NORMALIZATION_TYPE) + 0x1,
+};
+
+
+
+/*! \brief The Neural Network activation functions list.
+ * \details
+ * <table>
+ * <tr><td> <B>Function name </B> <td> <B>Mathematical definition</B> <td> <B>Parameters</B> <td> <B>Parameters type</B>
+ * <tr><td>logistic <td> \f$f(x)=1/(1+e^{-x}) \f$  <td>  <td>
+ * <tr><td>hyperbolic tangent <td> \f$f(x)=a\cdot tanh(b\cdot x) \f$  <td> a,b  <td> VX_FLOAT32
+ * <tr><td>relu <td> \f$f(x)=max(0,x)\f$  <td>  <td>
+ * <tr><td>bounded relu <td> \f$f(x)=min(a,max(0,x)) \f$  <td> a  <td> VX_FLOAT32
+ * <tr><td>soft relu <td> \f$f(x)=log(1+e^{x}) \f$  <td>  <td>
+ * <tr><td>abs <td> \f$f(x)=\mid x\mid \f$  <td>  <td>
+ * <tr><td>square <td> \f$f(x)= x^2 \f$  <td>  <td>
+ * <tr><td>square root <td> \f$f(x)=\sqrt{x} \f$  <td>  <td>
+ * <tr><td>linear <td> \f$f(x)=ax+b \f$  <td>  a,b  <td> VX_FLOAT32
+ * </table>
+ * \ingroup group_cnn
+ */
+enum vx_nn_activation_function_e
+{
+    VX_NN_ACTIVATION_LOGISTIC = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x0,
+    VX_NN_ACTIVATION_HYPERBOLIC_TAN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x1,
+    VX_NN_ACTIVATION_RELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x2,
+    VX_NN_ACTIVATION_BRELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x3,
+    VX_NN_ACTIVATION_SOFTRELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x4,
+    VX_NN_ACTIVATION_ABS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x5,
+    VX_NN_ACTIVATION_SQUARE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x6,
+    VX_NN_ACTIVATION_SQRT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x7,
+    VX_NN_ACTIVATION_LINEAR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x8,
+    VX_NN_ACTIVATION_PRELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x9,
+    VX_NN_ACTIVATION_RELU6 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0xA,
+    VX_NN_ACTIVATION_HARDSIGMOID = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0xB,
+};
+
+/*! \brief The type enumeration lists all NN extension types.
+ * \ingroup group_cnn
+ */
+enum vx_nn_type_e {
+	VX_TYPE_NN_CONVOLUTION_PARAMS     = 0x025,/*!< \brief A <tt>\ref vx_nn_convolution_params_t</tt>. */
+	VX_TYPE_NN_DECONVOLUTION_PARAMS   = 0x026,/*!< \brief A <tt>\ref vx_nn_deconvolution_params_t</tt>. */
+	VX_TYPE_NN_ROI_POOL_PARAMS        = 0x027,/*!< \brief A <tt>\ref vx_nn_roi_pool_params_t</tt>. */
+    VX_TYPE_NN_POOL_PARAMS            = 0x028,
+	VX_TYPE_NN_PERMUTE_PARAMS         = 0x02D,
+	VX_TYPE_NN_TENSOR_PYRAMID		  = 0x02E,
+	VX_TYPE_NN_CUSTOM_PARAMS		  = 0x02F,
+};
+
+/*! \brief Input parameters for a convolution operation.
+ * \ingroup group_cnn
+ */
+typedef struct _vx_nn_convolution_params_t
+{
+    vx_size padding_xl;                 /*!< \brief Number of elements added at each side in the x dimension of the input. */
+	vx_size padding_xr;
+    vx_size padding_yl;                 /*!< \brief Number of elements added at each side in the y dimension of the input. */
+	vx_size padding_yr;
+	vx_enum overflow_policy;         /*!< \brief A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_convert_policy_e</tt> enumeration. */
+    vx_enum rounding_policy;         /*!< \brief A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_round_policy_e</tt> enumeration. */
+    vx_enum down_scale_size_rounding; /*!< \brief Rounding method for calculating output dimensions. See <tt>\ref vx_nn_rounding_type_e</tt> */
+    vx_size dilation_x;            /*!< \brief “inflate” the kernel by inserting zeros between the kernel elements in the x direction. The value is the number of zeros to insert.*/
+    vx_size dilation_y;            /*!< \brief “inflate” the kernel by inserting zeros between the kernel elements in the y direction. The value is the number of zeros to insert.*/
+	vx_size input_channel;
+	vx_size input_channel_offset;
+	vx_size input_channel_width;
+	vx_size output_channel;
+	vx_size output_channel_offset;
+	vx_size output_channel_width;
+	vx_size group;
+	vx_size executor;
+} vx_nn_convolution_params_t;
+
+typedef struct _vx_nn_custom_params_t
+{
+    vx_size num;
+	vx_float32 params[16];
+}vx_nn_custom_params_t;
+
+typedef struct _vx_nn_pooling_params_t 
+{
+    vx_enum pooling_type;
+    vx_size pooling_size_x;
+    vx_size pooling_size_y;
+    vx_size pooling_padding_x;
+    vx_size pooling_padding_y;
+    vx_enum rounding_policy;
+} vx_nn_pooling_params_t;
+
+typedef struct _vx_tensor_array_t
+{
+	vx_size num;
+	vx_tensor tensors[256];
+}vx_tensor_array_t;
+
+typedef struct _vx_nn_permute_params_t
+{
+    vx_size axis_order0;
+    vx_size axis_order1;
+    vx_size axis_order2;
+    vx_size axis_order3;
+}vx_nn_permute_params_t;
+
+/*==============================================================================
+    NN Nodes
+=============================================================================*/
+/*! \brief [Graph] Creates a Convolutional Network Convolution Layer Node.
+ * \details This function implement Convolutional Network Convolution layer.
+ *  For fixed-point data types, a fixed point calculation is performed with round and saturate according to the number of accumulator bits. The number of the accumulator bits are implementation defined,
+ * and should be at least 16.\n
+ * round: rounding according the <tt>vx_round_policy_e</tt> enumeration. \n
+ * saturate: A saturation according the <tt>vx_convert_policy_e</tt> enumeration.
+ * The following equation is implemented: \n
+ * \f$ outputs[j,k,i] = saturate(round(\sum_{l} (\sum_{m,n} inputs[j+m,k+n,l] \times weights[m,n,l,i])+biasses[j,k,i])) \f$\n
+ * Where \f$m,n\f$ are indexes on the convolution matrices. \f$ l\f$ is an index on all the convolutions per input.\f$ i\f$ is an index per output.
+ * \f$ j,k \f$ are the inputs/outputs spatial indexes.
+ * Convolution is done on the width and height dimensions of the <tt>\ref vx_tensor</tt>. Therefore, we use here the term x for index along the width dimension and y for index along the height dimension.\n
+ * before the Convolution is done, a padding with zeros of the width and height input dimensions is performed.
+ * Then down scale is done by picking the results according to a skip jump. The skip in the x and y is determined by the output size dimensions.
+ * The relation between input to output is as follows: \n
+ * \f$ width_{output} = round(\frac{(width_{input} + 2 * padding_x - kernel_x - (kernel_x -1) * dilation_x)}{skip_x} + 1) \f$\n
+ * and \n
+ * \f$ height_{output} = round(\frac{(height + 2 * padding_y - kernel_y - (kernel_y -1) * dilation_y)}{skip_y} + 1) \f$\n 
+ * where \f$width\f$ is the size of the input width dimension. \f$height\f$ is the size of the input height dimension.
+ * \f$width_{output}\f$ is the size of the output width dimension. \f$height_{output}\f$ is the size of the output height dimension.
+ * \f$kernel_x\f$ and \f$kernel_y\f$ are the convolution sizes in width and height dimensions.
+ * skip is calculated by the relation between input and output. In case of ambiguity in the inverse calculation of the skip. The minimum solution is chosen. Skip must be a positive non zero integer.
+ * rounding is done according to <tt>\ref vx_nn_rounding_type_e</tt>.
+ * Notice that this node creation function has more parameters than the corresponding kernel. Numbering of kernel parameters (required if you create this node using the generic interface) is explicitly specified here.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data. 3 lower dimensions represent a single input, all following dimensions represent number of batches, possibly nested.
+ * The dimension order is [width, height, #IFM, #batches]\n. Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'.  (Kernel parameter #0)
+ * \param [in] weights [static] Weights are 4d tensor with dimensions [kernel_x, kernel_y, #IFM, #OFM]. see <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt> \n Weights data type must match the data type of the inputs.  (Kernel parameter #1)
+ * \param [in] biases [static] Optional, ignored if NULL. The biases, which may be shared (one per ofm) or unshared (one per ofm * output location). The possible layouts are
+ * either [#OFM] or [width, height, #OFM]. Biases data type must match the data type of the inputs.   (Kernel parameter #2)
+ * \param [in] convolution_params [static] Pointer to parameters of type <tt>\ref vx_nn_convolution_params_t</tt>.  (Kernel parameter #3)
+ * \param [in] size_of_convolution_params [static] Size in bytes of convolution_params. Note that this parameter is not counted as one of the kernel parameters.
+ * \param [out] outputs The output tensor data. Output will have the same number and structure of dimensions as input. Output tensor data type must be same as the inputs.  (Kernel parameter #4)
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_cnn
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxConvolutionLayer(vx_graph graph, 
+                                                    const vx_char* name,
+                                                    vx_size name_len,
+													vx_tensor inputs, 
+													vx_tensor weights, 
+													vx_tensor biases, 
+													const vx_nn_convolution_params_t* convolution_params, 
+													vx_size size_of_convolution_params, 
+													vx_tensor outputs);
+
+/*! \brief [Graph] Creates a Fully connected Convolutional Network Layer Node.
+ * \details This function implement Fully connected Convolutional Network layers.
+ * For fixed-point data types, a fixed point calculation is performed with round and saturate according to the number of accumulator bits. The number of the accumulator bits are implementation defined,
+ * and should be at least 16.\n
+ * round: rounding according the <tt>vx_round_policy_e</tt> enumeration. \n
+ * saturate: A saturation according the <tt>vx_convert_policy_e</tt> enumeration.
+ * The equation for Fully connected layer:\n
+ * \f$ outputs[i] = saturate(round(\sum_{j} (inputs[j] \times weights[j,i])+biasses[i])) \f$\n
+ * Where \f$j\f$ is a index on the input feature and \f$i\f$ is a index on the output.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data. There two possible input layouts:
+ * 1. [#IFM, #batches]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * 2. [width, height, #IFM, #batches]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>\n
+ * In both cases number of batches are optional and may be multidimensional.
+ * The second option is a special case to deal with convolution layer followed by fully connected.
+ * The dimension order is [#IFM, #batches]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>. Note that batch may be multidimensional. Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'. 
+ * \param [in] weights [static] Number of dimensions is 2. Dimensions are [#IFM, #OFM]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.\n Implementations must support input tensor data type same as the inputs.
+ * \param [in] biases [static] Optional, ignored if NULL. The biases have one dimension [#OFM]. Implementations must support input tensor data type same as the inputs.
+ * \param [in] overflow_policy [static] A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_convert_policy_e</tt> enumeration.
+ * \param [in] rounding_policy [static] A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_round_policy_e</tt> enumeration.
+ * \param [out] outputs The output tensor data. Output dimension layout is [#OFM,#batches]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>, where #batches may be multidimensional. Output tensor data type must be same as the inputs.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_cnn
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxFullyConnectedLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor inputs, vx_tensor weights, vx_tensor biases, vx_enum overflow_policy, vx_enum rounding_policy, vx_tensor outputs);
+
+
+/*! \brief [Graph] Creates a Convolutional Network Pooling Layer Node.
+ * \details Pooling is done on the width and height dimensions of the <tt>\ref vx_tensor</tt>. Therefore, we use here the term x for the width dimension and y for the height dimension.\n
+ * Pooling operation is a function operation over a rectangle size and then a nearest neighbour down scale.
+ * Here we use pooling_size_x and pooling_size_y to specify the rectangle size on which the operation
+ * is performed. \n
+ * before the operation is done (average or maximum value). the data is padded with zeros in width and height dimensions .
+ * The down scale is done by picking the results according to a skip jump. The skip in the x and y dimension is determined by the output size dimensions.
+ * The first pixel of the down scale output is the first pixel in the input.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data. 3 lower dimensions represent a single input, 4th dimension for batch of inputs is optional.Dimension layout is [width, height, #IFM, #batches].
+ * See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt> 
+ * Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'. 
+ * \param [in] pooling_type [static] Either max pooling or average pooling (see <tt>\ref vx_nn_pooling_type_e</tt>).
+ * \param [in] pooling_size_x [static] Size of the pooling region in the x dimension
+ * \param [in] pooling_size_y [static] Size of the pooling region in the y dimension.
+ * \param [in] pooling_padding_x [static] Padding size in the x dimension.
+ * \param [in] pooling_padding_y [static] Padding size in the y dimension.
+ * \param [in] rounding [static] Rounding method for calculating output dimensions. See <tt>\ref vx_nn_rounding_type_e</tt>
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input. Output tensor data type must be same as the inputs.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_cnn
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxPoolingLayer(
+    vx_graph graph,
+    const vx_char* name,
+    vx_size name_len,
+    vx_tensor inputs,
+    const vx_nn_pooling_params_t* pooling_params,
+    vx_size size_of_pooling_params,
+    vx_tensor outputs);
+
+/*! \brief [Graph] Creates a Convolutional Network Softmax Layer Node.
+ * \details  the softmax function, is a generalization of the logistic function that "squashes" a K-dimensional vector \f$ z \f$ of arbitrary real values to a K-dimensional vector
+ * \f$ \sigma(z) \f$ of real values in the range (0, 1) that add up to 1. The function is given by:
+ * \f$ \sigma(z) = \frac{\exp^z}{\sum_i \exp^{z_i}} \f$
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor,  with the number of dimensions according to the following scheme. 
+ * In case IFM dimension is 1. Softmax is be calculated on that dimension.
+ * In case IFM dimension is 2. Softmax is be calculated on the first dimension. The second dimension is batching.
+ * In case IFM dimension is 3. Dimensions are [Width, Height, Classes]. And Softmax is calculated on the third dimension.
+ * In case IFM dimension is 4. Dimensions are [Width, Height, Classes, batching]. Softmax is calculated on the third dimension.
+ * Regarding the layout specification, see <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * In all cases Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'. 
+ * \param [out] outputs The output tensor. Output will have the same number of dimensions as input. Output tensor data type must be same as the inputs.
+ * \ingroup group_cnn
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+
+VX_API_ENTRY vx_node VX_API_CALL vxSoftmaxLayer(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+
+/*! \brief [Graph] Creates a Convolutional Network Activation Layer Node.
+ * The function operate a specific function (Specified in <tt>\ref vx_nn_activation_function_e</tt>), On the input data.
+ * the equation for the layer is:
+ * \f$ outputs(i,j,k,l) = function(inputs(i,j,k,l), a, b) \f$ for all i,j,k,l.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'. 
+ * \param [in] function [static] Non-linear function (see <tt>\ref vx_nn_activation_function_e</tt>). Implementations must support <tt>\ref VX_NN_ACTIVATION_LOGISTIC</tt>, <tt>\ref VX_NN_ACTIVATION_HYPERBOLIC_TAN</tt> and <tt>\ref VX_NN_ACTIVATION_RELU</tt>
+ * \param [in] a [static] Function parameters a. must be positive.
+ * \param [in] b [static] Function parameters b. must be positive.
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input.
+ * \ingroup group_cnn
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxActivationLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor inputs, vx_enum function, vx_tensor weights, vx_tensor outputs);
+	
+#ifdef  __cplusplus
+}
+#endif
+
+
+#endif

+ 116 - 0
include/VX/vx_nodes.h

@@ -0,0 +1,116 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_NODES_H_
+#define _OPENVX_NODES_H_
+
+/*!
+ * \file vx_nodes.h
+ * \brief The "Simple" API interface for OpenVX. These APIs are just
+ * wrappers around the more verbose functions defined in <tt>\ref vx_api.h</tt>.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief [Graph] Performs element wise multiplications on element values in the input tensor data with a scale.
+ * \param [in] graph The handle to the graph.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.  
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
+ * The data type must match the data type of Input1.
+ * \param [in] scale A non-negative <tt>\ref VX_TYPE_FLOAT32</tt> multiplied to each product before overflow handling.
+ * \param [in] overflow_policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] rounding_policy A <tt>\ref vx_round_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_multiply
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorMultiplyNode(vx_graph graph, vx_tensor input1, vx_tensor input2, vx_scalar scale, vx_enum overflow_policy,
+        vx_enum rounding_policy, vx_tensor output);
+
+/*! \brief [Graph] Performs arithmetic addition on element values in the input tensor data.
+ * \param [in] graph The handle to the graph.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.  
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal. 
+ * The data type must match the data type of Input1. 
+ * \param [in] policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_add
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorAddNode(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor input1, vx_tensor input2, vx_enum policy, vx_tensor output);
+
+/*! \brief [Graph] Performs arithmetic subtraction on element values in the input tensor data.
+ * \param [in] graph The handle to the graph.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.  
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal. 
+ * The data type must match the data type of Input1. 
+ * \param [in] policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_subtract
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorSubtractNode(vx_graph graph, vx_tensor input1, vx_tensor input2, vx_enum policy, vx_tensor output);
+
+/*! \brief [Graph] Performs LUT on element values in the input tensor data.
+ * \param [in] graph The handle to the graph.
+ * \param [in] input1 Input tensor data. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8, 
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt>, with fixed_point_position 0. 
+ * \param [in] lut The look-up table to use, of type <tt>\ref vx_lut</tt>.
+ * The elements of input1 are treated as unsigned integers to determine an index into the look-up table.
+ * The data type of the items in the look-up table must match that of the output tensor.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_tablelookup
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorTableLookupNode(vx_graph graph, vx_tensor input1, vx_lut lut, vx_tensor output);
+
+/*! \brief Copy data from one object to another.
+ * \note An implementation may optimize away the copy when virtual data objects are used.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input data object.
+ * \param [out] output The output data object with meta-data identical to the input data object.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation
+ * should be checked using <tt>\ref vxGetStatus</tt>
+ * \ingroup group_vision_function_copy
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxCopyNode(vx_graph graph, vx_reference input, vx_reference output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 1077 - 0
include/VX/vx_types.h

@@ -0,0 +1,1077 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_TYPES_H_
+#define _OPENVX_TYPES_H_
+
+/*!
+ * \file vx_types.h
+ * \brief The type definitions required by OpenVX Library.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+
+/*!
+ * \internal
+ * \def VX_API_ENTRY
+ * \brief This is a tag used to identify exported, public API functions as
+ * distinct from internal functions, helpers, and other non-public interfaces.
+ * It can optionally be defined in the make system according the the compiler and intent.
+ * \ingroup group_basic_features
+ */
+
+/*!
+ * \def VX_API_CALL
+ * \brief Defines calling convention for OpenVX API.
+ * \ingroup group_basic_features
+ */
+
+/*!
+ * \def VX_CALLBACK
+ * \brief Defines calling convention for user callbacks.
+ * \ingroup group_basic_features
+ */
+
+#ifndef VX_API_ENTRY
+#if defined(_WIN32)
+#define VX_API_ENTRY __declspec(dllexport)
+#define VX_API_DEPRECATED __declspec(deprecated)
+#else
+#define VX_API_ENTRY __attribute((visibility("default")))
+#define VX_API_DEPRECATED __attribute((deprecated))
+#endif
+#endif
+#ifndef VX_API_CALL
+#if defined(_WIN32)
+#define VX_API_CALL __stdcall
+#else
+#define VX_API_CALL
+#endif
+#endif
+#ifndef VX_CALLBACK
+#if defined(_WIN32)
+#define VX_CALLBACK __stdcall
+#else
+#define VX_CALLBACK
+#endif
+#endif
+
+/*! \brief An 8 bit ASCII character.
+ * \ingroup group_basic_features
+ */
+typedef char     vx_char;
+
+/*! \brief An 8-bit unsigned value.
+ * \ingroup group_basic_features
+ */
+typedef uint8_t  vx_uint8;
+
+/*! \brief A 16-bit unsigned value.
+ * \ingroup group_basic_features
+ */
+typedef uint16_t vx_uint16;
+
+/*! \brief A 32-bit unsigned value.
+ * \ingroup group_basic_features
+ */
+typedef uint32_t vx_uint32;
+
+/*! \brief A 64-bit unsigned value.
+ * \ingroup group_basic_features
+ */
+typedef uint64_t vx_uint64;
+
+/*! \brief An 8-bit signed value.
+ * \ingroup group_basic_features
+ */
+typedef int8_t   vx_int8;
+
+/*! \brief A 16-bit signed value.
+ * \ingroup group_basic_features
+ */
+typedef int16_t  vx_int16;
+
+/*! \brief A 32-bit signed value.
+ * \ingroup group_basic_features
+ */
+typedef int32_t  vx_int32;
+
+/*! \brief A 64-bit signed value.
+ * \ingroup group_basic_features
+ */
+typedef int64_t  vx_int64;
+
+typedef uint32_t vx_bitfield;
+
+#if defined(EXPERIMENTAL_PLATFORM_SUPPORTS_16_FLOAT)
+
+/*! \brief A 16-bit float value.
+ * \ingroup group_basic_features
+ */
+typedef hfloat   vx_float16;
+#endif
+
+/*! \brief A 32-bit float value.
+ * \ingroup group_basic_features
+ */
+typedef float    vx_float32;
+
+/*! \brief A 64-bit float value (aka double).
+ * \ingroup group_basic_features
+ */
+typedef double   vx_float64;
+
+/*! \brief A generic opaque reference to any object within OpenVX.
+ * \details A user of OpenVX should not assume that this can be cast directly to anything;
+ * however, any object in OpenVX can be cast back to this for the purposes of
+ * querying attributes of the object or for passing the object as a parameter to
+ * functions that take a <tt>\ref vx_reference</tt> type.
+ * If the API does not take that specific type but may take others, an
+ * error may be returned from the API.
+ * \ingroup group_reference
+ */
+typedef struct _vx_reference *vx_reference;
+
+/*! \brief Sets the standard enumeration type size to be a fixed quantity.
+ * \details All enumerable fields must use this type as the container to
+ * enforce enumeration ranges and sizeof() operations.
+ * \ingroup group_basic_features
+ */
+typedef int32_t vx_enum;
+
+/*! \brief A wrapper of <tt>size_t</tt> to keep the naming convention uniform.
+ * \ingroup group_basic_features
+ */
+typedef size_t vx_size;
+
+/*! \brief Used to hold a VX_DF_IMAGE code to describe the pixel format and color space.
+ * \ingroup group_basic_features
+ */
+typedef uint32_t vx_df_image;
+
+/*! \brief An opaque reference to a scalar.
+ * \details A scalar can be up to 64 bits wide.
+ * \see vxCreateScalar
+ * \ingroup group_scalar
+ * \extends vx_reference
+ */
+typedef struct _vx_scalar *vx_scalar;
+
+/*! \brief An opaque reference to an image.
+ * \see vxCreateImage
+ * \ingroup group_image
+ * \extends vx_reference
+ */
+typedef struct _vx_image *vx_image;
+
+/*! \brief An opaque reference to the descriptor of a kernel.
+ * \see vxGetKernelByName
+ * \see vxGetKernelByEnum
+ * \ingroup group_kernel
+ * \extends vx_reference
+ */
+typedef struct _vx_kernel *vx_kernel;
+
+/*! \brief An opaque reference to a single parameter.
+ * \see vxGetParameterByIndex
+ * \ingroup group_parameter
+ * \extends vx_reference
+ */
+typedef struct _vx_parameter *vx_parameter;
+
+/*! \brief An opaque reference to a kernel node.
+ * \see vxCreateGenericNode
+ * \ingroup group_node
+ * \extends vx_reference
+ */
+typedef struct _vx_node *vx_node;
+
+/*! \brief An opaque reference to a graph
+ * \see vxCreateGraph
+ * \ingroup group_graph
+ * \extends vx_reference
+ */
+typedef struct _vx_graph *vx_graph;
+
+/*! \brief An opaque reference to the implementation context.
+ * \see vxCreateContext
+ * \ingroup group_context
+ * \extends vx_reference
+ */
+typedef struct _vx_context *vx_context;
+
+/*! \brief The delay object. This is like a ring buffer of objects that is
+ * maintained by the OpenVX implementation.
+ * \see vxCreateDelay
+ * \extends vx_reference
+ * \ingroup group_delay
+ */
+typedef struct _vx_delay *vx_delay;
+
+/*! \brief The Look-Up Table (LUT) Object.
+ * \extends vx_reference
+ * \ingroup group_lut
+ */
+typedef struct _vx_lut *vx_lut;
+
+/*! \brief The Distribution object. This has a user-defined number of bins over
+ * a user-defined range (within a uint32_t range).
+ * \extends vx_reference
+ * \ingroup group_distribution
+ */
+typedef struct _vx_distribution *vx_distribution;
+
+/*! \brief The Matrix Object. An MxN matrix of some unit type.
+ * \extends vx_reference
+ * \ingroup group_matrix
+ */
+typedef struct _vx_matrix *vx_matrix;
+
+/*! \brief The Image Pyramid object. A set of scaled images.
+ * \extends vx_reference
+ * \ingroup group_pyramid
+ */
+typedef struct _vx_pyramid *vx_pyramid;
+
+/*! \brief The Threshold Object. A thresholding object contains the types and
+ * limit values of the thresholding required.
+ * \extends vx_reference
+ * \ingroup group_threshold
+ */
+typedef struct _vx_threshold *vx_threshold;
+
+/*! \brief The Convolution Object. A user-defined convolution kernel of MxM elements.
+ * \extends vx_reference
+ * \ingroup group_convolution
+ */
+typedef struct _vx_convolution *vx_convolution;
+
+/*! \brief The remap table Object. A remap table contains per-pixel mapping of
+ * output pixels to input pixels.
+ * \ingroup group_remap
+ */
+typedef struct _vx_remap *vx_remap;
+
+/*! \brief The Array Object. Array is a strongly-typed container for other data structures.
+ * \ingroup group_array
+ */
+typedef struct _vx_array *vx_array;
+
+/*! \brief The ObjectArray Object. ObjectArray is a strongly-typed container of OpenVX data-objects.
+ * \ingroup group_object_array
+ */
+typedef struct _vx_object_array *vx_object_array;
+ 
+ /*! \brief The multidimensional data object (Tensor).
+ * \see vxCreateTensor
+ * \ingroup group_object_tensor
+ * \extends vx_reference
+ */
+typedef struct _vx_tensor_t * vx_tensor;
+
+
+
+/*! \brief A Boolean value.
+ * This allows 0 to be FALSE, as it is in C, and any non-zero to be TRUE.
+ * \code
+ * vx_bool ret = vx_true_e;
+ * if (ret) printf("true!\n");
+ * ret = vx_false_e;
+ * if (!ret) printf("false!\n");
+ * \endcode
+ * This would print both strings.
+ * \see vx_bool
+ * \ingroup group_basic_features
+ */
+typedef enum _vx_bool_e {
+    /*! \brief The "false" value. */
+    vx_false_e = 0,
+    /*! \brief The "true" value. */
+    vx_true_e,
+} vx_bool_e;
+
+/*! \brief A formal boolean type with known fixed size.
+ * \see vx_bool_e
+ * \ingroup group_basic_features
+ */
+typedef vx_enum vx_bool;
+
+/*!
+ * \brief This object is used by output validation functions to specify the meta data
+ * of the expected output data object.
+ * \note When the actual output object of the user node is virtual, the information
+ * given through the vx_meta_format object allows the OpenVX framework to automatically
+ * create the data object when meta data were not specified by the application at object
+ * creation time.
+ * \ingroup group_user_kernels
+ */
+typedef struct _vx_meta_format* vx_meta_format;
+
+/*! \brief The type enumeration lists all the known types in OpenVX.
+ * \ingroup group_basic_features
+ */
+enum vx_type_e {
+    VX_TYPE_INVALID         = 0x000,/*!< \brief An invalid type value. When passed an error must be returned. */
+    VX_TYPE_CHAR            = 0x001,/*!< \brief A <tt>\ref vx_char</tt>. */
+    VX_TYPE_INT8            = 0x002,/*!< \brief A <tt>\ref vx_int8</tt>. */
+    VX_TYPE_UINT8           = 0x003,/*!< \brief A <tt>\ref vx_uint8</tt>. */
+    VX_TYPE_INT16           = 0x004,/*!< \brief A <tt>\ref vx_int16</tt>. */
+    VX_TYPE_UINT16          = 0x005,/*!< \brief A <tt>\ref vx_uint16</tt>. */
+    VX_TYPE_INT32           = 0x006,/*!< \brief A <tt>\ref vx_int32</tt>. */
+    VX_TYPE_UINT32          = 0x007,/*!< \brief A <tt>\ref vx_uint32</tt>. */
+    VX_TYPE_INT64           = 0x008,/*!< \brief A <tt>\ref vx_int64</tt>. */
+    VX_TYPE_UINT64          = 0x009,/*!< \brief A <tt>\ref vx_uint64</tt>. */
+    VX_TYPE_FLOAT32         = 0x00A,/*!< \brief A <tt>\ref vx_float32</tt>. */
+    VX_TYPE_FLOAT64         = 0x00B,/*!< \brief A <tt>\ref vx_float64</tt>. */
+    VX_TYPE_ENUM            = 0x00C,/*!< \brief A <tt>\ref vx_enum</tt>. Equivalent in size to a <tt>\ref vx_int32</tt>. */
+    VX_TYPE_SIZE            = 0x00D,/*!< \brief A <tt>\ref vx_size</tt>. */
+    VX_TYPE_BOOL            = 0x010,/*!< \brief A <tt>\ref vx_bool</tt>. */
+
+    VX_TYPE_RECTANGLE       = 0x020,/*!< \brief A <tt>\ref vx_rectangle_t</tt>. */
+    VX_TYPE_KEYPOINT        = 0x021,/*!< \brief A <tt>\ref vx_keypoint_t</tt>. */
+    VX_TYPE_COORDINATES2D   = 0x022,/*!< \brief A <tt>\ref vx_coordinates2d_t</tt>. */
+    VX_TYPE_COORDINATES3D   = 0x023,/*!< \brief A <tt>\ref vx_coordinates3d_t</tt>. */
+    VX_TYPE_COORDINATES2DF  = 0x024,/*!< \brief A <tt>\ref vx_coordinates2df_t</tt>. */
+		
+    VX_TYPE_USER_STRUCT_START    = 0x100,/*!< \brief A user-defined struct base index.*/
+    VX_TYPE_VENDOR_STRUCT_START  = 0x400,/*!< \brief A vendor-defined struct base index.*/
+    VX_TYPE_KHRONOS_OBJECT_START = 0x800,/*!< \brief A Khronos defined object base index. */
+    VX_TYPE_VENDOR_OBJECT_START  = 0xC00,/*!< \brief A vendor defined object base index. */
+
+    VX_TYPE_KHRONOS_STRUCT_MAX   = VX_TYPE_USER_STRUCT_START - 1,/*!< \brief A value for comparison between Khronos defined structs and user structs. */
+
+    VX_TYPE_USER_STRUCT_END      = VX_TYPE_VENDOR_STRUCT_START - 1,/*!< \brief A value for comparison between user structs and vendor structs. */
+    VX_TYPE_VENDOR_STRUCT_END    = VX_TYPE_KHRONOS_OBJECT_START - 1,/*!< \brief A value for comparison between vendor structs and Khronos defined objects. */
+    VX_TYPE_KHRONOS_OBJECT_END   = VX_TYPE_VENDOR_OBJECT_START - 1,/*!< \brief A value for comparison between Khronos defined objects and vendor structs. */
+    VX_TYPE_VENDOR_OBJECT_END    = 0xFFF,/*!< \brief A value used for bound checking of vendor objects */
+
+
+    VX_TYPE_REFERENCE       = 0x800,/*!< \brief A <tt>\ref vx_reference</tt>. */
+    VX_TYPE_CONTEXT         = 0x801,/*!< \brief A <tt>\ref vx_context</tt>. */
+    VX_TYPE_GRAPH           = 0x802,/*!< \brief A <tt>\ref vx_graph</tt>. */
+    VX_TYPE_NODE            = 0x803,/*!< \brief A <tt>\ref vx_node</tt>. */
+    VX_TYPE_KERNEL          = 0x804,/*!< \brief A <tt>\ref vx_kernel</tt>. */
+    VX_TYPE_PARAMETER       = 0x805,/*!< \brief A <tt>\ref vx_parameter</tt>. */
+    VX_TYPE_DELAY           = 0x806,/*!< \brief A <tt>\ref vx_delay</tt>. */
+    VX_TYPE_SCALAR          = 0x80D,/*!< \brief A <tt>\ref vx_scalar</tt>. when needed to be completely generic for kernel validation. */    
+    VX_TYPE_ERROR           = 0x811,/*!< \brief An error object which has no type. */
+    VX_TYPE_META_FORMAT     = 0x812,/*!< \brief A <tt>\ref vx_meta_format</tt>. */
+    VX_TYPE_OBJECT_ARRAY    = 0x813,/*!< \brief A <tt>\ref vx_object_array</tt>. */
+    VX_TYPE_TENSOR          = 0x815,/*!< \brief A <tt>\ref vx_tensor</tt>. */
+	VX_TYPE_TENSOR_ARRAY	= 0x817,
+    VX_TYPE_DEVICE_MEMORY_HANDLE = 0x818,
+};
+
+/*! \brief The enumeration of all status codes.
+ * \see vx_status.
+ * \ingroup group_basic_features
+ */
+enum vx_status_e {
+    VX_STATUS_MIN                       = -25,/*!< \brief Indicates the lower bound of status codes in VX. Used for bounds checks only. */
+    /* add new codes here */
+    VX_ERROR_REFERENCE_NONZERO          = -24,/*!< \brief Indicates that an operation did not complete due to a reference count being non-zero. */
+    VX_ERROR_MULTIPLE_WRITERS           = -23,/*!< \brief Indicates that the graph has more than one node outputting to the same data object. This is an invalid graph structure. */
+    VX_ERROR_GRAPH_ABANDONED            = -22,/*!< \brief Indicates that the graph is stopped due to an error or a callback that abandoned execution. */
+    VX_ERROR_GRAPH_SCHEDULED            = -21,/*!< \brief Indicates that the supplied graph already has been scheduled and may be currently executing. */
+    VX_ERROR_INVALID_SCOPE              = -20,/*!< \brief Indicates that the supplied parameter is from another scope and cannot be used in the current scope. */
+    VX_ERROR_INVALID_NODE               = -19,/*!< \brief Indicates that the supplied node could not be created.*/
+    VX_ERROR_INVALID_GRAPH              = -18,/*!< \brief Indicates that the supplied graph has invalid connections (cycles). */
+    VX_ERROR_INVALID_TYPE               = -17,/*!< \brief Indicates that the supplied type parameter is incorrect. */
+    VX_ERROR_INVALID_VALUE              = -16,/*!< \brief Indicates that the supplied parameter has an incorrect value. */
+    VX_ERROR_INVALID_DIMENSION          = -15,/*!< \brief Indicates that the supplied parameter is too big or too small in dimension. */
+    VX_ERROR_INVALID_FORMAT             = -14,/*!< \brief Indicates that the supplied parameter is in an invalid format. */
+    VX_ERROR_INVALID_LINK               = -13,/*!< \brief Indicates that the link is not possible as specified. The parameters are incompatible. */
+    VX_ERROR_INVALID_REFERENCE          = -12,/*!< \brief Indicates that the reference provided is not valid. */
+    VX_ERROR_INVALID_MODULE             = -11,/*!< \brief This is returned from <tt>\ref vxLoadKernels</tt> when the module does not contain the entry point. */
+    VX_ERROR_INVALID_PARAMETERS         = -10,/*!< \brief Indicates that the supplied parameter information does not match the kernel contract. */
+    VX_ERROR_OPTIMIZED_AWAY             = -9,/*!< \brief Indicates that the object refered to has been optimized out of existence. */
+    VX_ERROR_NO_MEMORY                  = -8,/*!< \brief Indicates that an internal or implicit allocation failed. Typically catastrophic. After detection, deconstruct the context. \see vxVerifyGraph. */
+    VX_ERROR_NO_RESOURCES               = -7,/*!< \brief Indicates that an internal or implicit resource can not be acquired (not memory). This is typically catastrophic. After detection, deconstruct the context. \see vxVerifyGraph. */
+    VX_ERROR_NOT_COMPATIBLE             = -6,/*!< \brief Indicates that the attempt to link two parameters together failed due to type incompatibilty. */
+    VX_ERROR_NOT_ALLOCATED              = -5,/*!< \brief Indicates to the system that the parameter must be allocated by the system.  */
+    VX_ERROR_NOT_SUFFICIENT             = -4,/*!< \brief Indicates that the given graph has failed verification due to an insufficient number of required parameters, which cannot be automatically created. Typically this indicates required atomic parameters. \see vxVerifyGraph. */
+    VX_ERROR_NOT_SUPPORTED              = -3,/*!< \brief Indicates that the requested set of parameters produce a configuration that cannot be supported. Refer to the supplied documentation on the configured kernels. \see vx_kernel_e. This is also returned if a function to set an attribute is called on a Read-only attribute.*/
+    VX_ERROR_NOT_IMPLEMENTED            = -2,/*!< \brief Indicates that the requested kernel is missing. \see vx_kernel_e vxGetKernelByName. */
+    VX_FAILURE                          = -1,/*!< \brief Indicates a generic error code, used when no other describes the error. */
+    VX_SUCCESS                          =  0,/*!< \brief No error. */
+};
+
+/*! \brief A formal status type with known fixed size.
+ * \see vx_status_e
+ * \ingroup group_basic_features
+ */
+typedef vx_enum vx_status;
+
+/*! \brief The formal typedef of the response from the callback.
+ * \see vx_action_e
+ * \ingroup group_node_callback
+ */
+typedef vx_enum vx_action;
+
+/*! \brief A callback to the client after a particular node has completed.
+ * \see vx_action
+ * \see vxAssignNodeCallback
+ * \param [in] node The node to which the callback was attached.
+ * \return An action code from <tt>\ref vx_action_e</tt>.
+ * \ingroup group_node_callback
+ */
+typedef vx_action (VX_CALLBACK *vx_nodecomplete_f)(vx_node node);
+
+/*! \brief Vendor IDs are 2 nibbles in size and are located in the upper byte of
+ * the 4 bytes of an enumeration.
+ * \ingroup group_basic_features
+ */
+#define VX_VENDOR_MASK                      (0xFFF00000)
+
+/*! \brief A type mask removes the scalar/object type from the attribute.
+ * It is 3 nibbles in size and is contained between the third and second byte.
+ * \see vx_type_e
+ * \ingroup group_basic_features
+ */
+#define VX_TYPE_MASK                        (0x000FFF00)
+
+/*! \brief A library is a set of vision kernels with its own ID supplied by a vendor.
+ * The vendor defines the library ID. The range is \f$ [0,2^{8}-1] \f$ inclusive.
+ * \ingroup group_basic_features
+ */
+#define VX_LIBRARY_MASK                     (0x000FF000)
+
+/*! \brief An individual kernel in a library has its own unique ID within \f$ [0,2^{12}-1] \f$ (inclusive).
+ * \ingroup group_basic_features
+ */
+#define VX_KERNEL_MASK                      (0x00000FFF)
+
+/*! \brief An object's attribute ID is within the range of \f$ [0,2^{8}-1] \f$ (inclusive).
+ * \ingroup group_basic_features
+ */
+#define VX_ATTRIBUTE_ID_MASK                (0x000000FF)
+
+/*! \brief A type of enumeration. The valid range is between \f$ [0,2^{8}-1] \f$ (inclusive).
+ * \ingroup group_basic_features
+ */
+#define VX_ENUM_TYPE_MASK                   (0x000FF000)
+
+/*! \brief A generic enumeration list can have values between \f$ [0,2^{12}-1] \f$ (inclusive).
+ * \ingroup group_basic_features
+ */
+#define VX_ENUM_MASK                        (0x00000FFF)
+
+/*! \brief A macro to extract the vendor ID from the enumerated value.
+ * \ingroup group_basic_features
+ */
+#define VX_VENDOR(e)                        (((vx_uint32)e & VX_VENDOR_MASK) >> 20)
+
+/*! \brief A macro to extract the type from an enumerated attribute value.
+ * \ingroup group_basic_features
+ */
+#define VX_TYPE(e)                          (((vx_uint32)e & VX_TYPE_MASK) >> 8)
+
+/*! \brief A macro to extract the enum type from an enumerated value.
+ * \ingroup group_basic_features
+ */
+#define VX_ENUM_TYPE(e)                     (((vx_uint32)e & VX_ENUM_TYPE_MASK) >> 12)
+
+/*! \brief A macro to extract the kernel library enumeration from a enumerated kernel value.
+ * \ingroup group_basic_features
+ */
+#define VX_LIBRARY(e)                       (((vx_uint32)e & VX_LIBRARY_MASK) >> 12)
+
+/*! \def VX_DF_IMAGE
+ * \brief Converts a set of four chars into a \c uint32_t container of a VX_DF_IMAGE code.
+ * \note Use a <tt>\ref vx_df_image</tt> variable to hold the value.
+ * \ingroup group_basic_features
+ */
+#define VX_DF_IMAGE(a,b,c,d)                  ((a) | (b << 8) | (c << 16) | (d << 24))
+
+/*! \def VX_ATTRIBUTE_BASE
+ * \brief Defines the manner in which to combine the Vendor and Object IDs to get
+ * the base value of the enumeration.
+ * \ingroup group_basic_features
+ */
+#define VX_ATTRIBUTE_BASE(vendor, object)   (((vendor) << 20) | (object << 8))
+
+/*! \def VX_KERNEL_BASE
+ * \brief Defines the manner in which to combine the Vendor and Library IDs to get
+ * the base value of the enumeration.
+ * \ingroup group_basic_features
+ */
+#define VX_KERNEL_BASE(vendor, lib)         (((vendor) << 20) | (lib << 12))
+
+/*! \def VX_ENUM_BASE
+ * \brief Defines the manner in which to combine the Vendor and Object IDs to get
+ * the base value of the enumeration.
+ * \details From any enumerated value (with exceptions), the vendor, and enumeration
+ * type should be extractable. Those types that are exceptions are
+ * <tt>\ref vx_vendor_id_e</tt>, <tt>\ref vx_type_e</tt>, <tt>\ref vx_enum_e</tt>, <tt>\ref vx_df_image_e</tt>, and \c vx_bool.
+ * \ingroup group_basic_features
+ */
+#define VX_ENUM_BASE(vendor, id)            (((vendor) << 20) | (id << 12))
+
+/*! \brief The set of supported enumerations in OpenVX.
+ * \details These can be extracted from enumerated values using <tt>\ref VX_ENUM_TYPE</tt>.
+ * \ingroup group_basic_features
+ */
+enum vx_enum_e {
+    VX_ENUM_DIRECTION       = 0x00, /*!< \brief Parameter Direction. */
+    VX_ENUM_ACTION          = 0x01, /*!< \brief Action Codes. */
+    VX_ENUM_HINT            = 0x02, /*!< \brief Hint Values. */
+    VX_ENUM_DIRECTIVE       = 0x03, /*!< \brief Directive Values. */
+    VX_ENUM_INTERPOLATION   = 0x04, /*!< \brief Interpolation Types. */
+    VX_ENUM_OVERFLOW        = 0x05, /*!< \brief Overflow Policies. */
+    VX_ENUM_COLOR_SPACE     = 0x06, /*!< \brief Color Space. */
+    VX_ENUM_COLOR_RANGE     = 0x07, /*!< \brief Color Space Range. */
+    VX_ENUM_PARAMETER_STATE = 0x08, /*!< \brief Parameter State. */
+    VX_ENUM_CHANNEL         = 0x09, /*!< \brief Channel Name. */
+    VX_ENUM_CONVERT_POLICY  = 0x0A, /*!< \brief Convert Policy. */
+    VX_ENUM_THRESHOLD_TYPE  = 0x0B, /*!< \brief Threshold Type List. */
+    VX_ENUM_BORDER          = 0x0C, /*!< \brief Border Mode List. */
+    VX_ENUM_COMPARISON      = 0x0D, /*!< \brief Comparison Values. */
+    VX_ENUM_MEMORY_TYPE     = 0x0E, /*!< \brief The memory type enumeration. */
+    VX_ENUM_TERM_CRITERIA   = 0x0F, /*!< \brief A termination criteria. */
+    VX_ENUM_NORM_TYPE       = 0x10, /*!< \brief A norm type. */
+    VX_ENUM_ACCESSOR        = 0x11, /*!< \brief An accessor flag type. */
+    VX_ENUM_ROUND_POLICY    = 0x12, /*!< \brief Rounding Policy. */
+    VX_ENUM_TARGET          = 0x13, /*!< \brief Target. */
+    VX_ENUM_BORDER_POLICY   = 0x14, /*!< \brief Unsupported Border Mode Policy List. */
+    VX_ENUM_GRAPH_STATE     = 0x15, /*!< \brief Graph attribute states. */
+    VX_ENUM_NONLINEAR       = 0x16, /*!< \brief Non-linear function list. */
+    VX_ENUM_PATTERN         = 0x17, /*!< \brief Matrix pattern enumeration. */
+    VX_ENUM_LBP_FORMAT      = 0x18, /*!< \brief Lbp format. */
+    VX_ENUM_COMP_METRIC     = 0x19, /*!< \brief Compare metric. */
+    VX_ENUM_SCALAR_OPERATION= 0X20  /*!< \brief Scalar operation list. */
+};
+
+/*! \brief A return code enumeration from a <tt>\ref vx_nodecomplete_f</tt> during execution.
+ * \see <tt>vxAssignNodeCallback</tt>
+ * \ingroup group_node_callback
+ */
+enum vx_action_e {
+    /*! \brief Continue executing the graph with no changes. */
+    VX_ACTION_CONTINUE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACTION) + 0x0,
+    /*! \brief Stop executing the graph. */
+    VX_ACTION_ABANDON  = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACTION) + 0x1,
+};
+
+/*! \brief An indication of how a kernel will treat the given parameter.
+ * \ingroup group_parameter
+ */
+enum vx_direction_e {
+    /*! \brief The parameter is an input only. */
+    VX_INPUT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTION) + 0x0,
+    /*! \brief The parameter is an output only. */
+    VX_OUTPUT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTION) + 0x1,
+    /*! \brief The parameter is both an input and output. */
+    VX_BIDIRECTIONAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTION) + 0x2,
+};
+
+/*! \brief The Graph State Enumeration.
+ * \ingroup group_graph
+ */
+enum vx_graph_state_e {
+   /*! \brief The graph should be verified before execution */
+   VX_GRAPH_STATE_UNVERIFIED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x0,
+   /*! \brief The graph has been verified and has not been executed or scheduled for execution yet */
+   VX_GRAPH_STATE_VERIFIED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x1,
+   /*! \brief The graph either has been scheduled and not completed, or is being executed */
+   VX_GRAPH_STATE_RUNNING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x2,
+   /*! \brief The graph execution was abandoned */
+   VX_GRAPH_STATE_ABANDONED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x3,
+   /*! \brief The graph execution is completed and the graph is not scheduled for execution */
+   VX_GRAPH_STATE_COMPLETED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x4,
+};
+
+/*! \brief The graph attributes list.
+ * \ingroup group_graph
+ */
+enum vx_graph_attribute_e {
+    /*! \brief Returns the number of nodes in a graph. Read-only. Use a <tt>\ref vx_uint32</tt> parameter.*/
+    VX_GRAPH_NUMNODES = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x0,
+    /*! \brief Returns the overall performance of the graph. Read-only. Use a <tt>\ref vx_perf_t</tt> parameter.
+     * The accuracy of timing information is platform dependent.
+     * \note Performance tracking must have been enabled. See <tt>\ref vx_directive_e</tt>
+     */
+    VX_GRAPH_PERFORMANCE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x2,
+    /*! \brief Returns the number of explicitly declared parameters on the graph. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_GRAPH_NUMPARAMETERS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x3,
+    /*! \brief Returns the state of the graph. See <tt>\ref vx_graph_state_e</tt> enum. */
+    VX_GRAPH_STATE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x4,
+};
+
+/*! \brief The Conversion Policy Enumeration.
+ * \ingroup group_basic_features
+ */
+enum vx_convert_policy_e {
+    /*! \brief Results are the least significant bits of the output operand, as if
+     * stored in two's complement binary format in the size of its bit-depth.
+     */
+    VX_CONVERT_POLICY_WRAP = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CONVERT_POLICY) + 0x0,
+    /*! \brief Results are saturated to the bit depth of the output operand. */
+    VX_CONVERT_POLICY_SATURATE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CONVERT_POLICY) + 0x1,
+};
+
+/*! \brief The Target Enumeration.
+ * \ingroup group_basic_features
+ */
+enum vx_target_e {
+    /*! \brief Any available target. An OpenVX implementation must support at least one target associated with this value */
+    VX_TARGET_ANY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TARGET) + 0x0000,
+    /*! \brief Target, explicitly specified by its (case-insensitive) name string. */
+    VX_TARGET_STRING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TARGET) + 0x0001,
+    /*! \brief Start of Vendor specific target enumerates. */
+    VX_TARGET_VENDOR_BEGIN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TARGET) + 0x1000,
+};
+
+/*! \brief The reference attributes list.
+ * \ingroup group_reference
+ */
+enum vx_reference_attribute_e {
+    /*! \brief Returns the reference count of the object. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_REFERENCE_COUNT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REFERENCE) + 0x0,
+    /*! \brief Returns the <tt>\ref vx_type_e</tt> of the reference. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_REFERENCE_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REFERENCE) + 0x1,
+    /*! \brief Used to query the reference for its name. Read-write. Use a *<tt>\ref vx_char</tt> parameter. */
+    VX_REFERENCE_NAME = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REFERENCE) + 0x2,
+};
+
+/*! \brief A list of context attributes.
+ * \ingroup group_context
+ */
+enum vx_context_attribute_e {
+    /*! \brief Queries the unique vendor ID. Read-only. Use a <tt>\ref vx_uint16</tt>. */
+    VX_CONTEXT_VENDOR_ID = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x0,
+    /*! \brief Queries the OpenVX Version Number. Read-only. Use a <tt>\ref vx_uint16</tt> */
+    VX_CONTEXT_VERSION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x1,
+    /*! \brief Queries the context for the number of \e unique kernels. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_CONTEXT_UNIQUE_KERNELS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x2,
+    /*! \brief Queries the context for the number of active modules. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_CONTEXT_MODULES = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x3,
+    /*! \brief Queries the context for the number of active references. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_CONTEXT_REFERENCES = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x4,
+    /*! \brief Queries the context for it's implementation name. Read-only. Use a <tt>\ref vx_char</tt>[<tt>\ref VX_MAX_IMPLEMENTATION_NAME</tt>] array */
+    VX_CONTEXT_IMPLEMENTATION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x5,
+    /*! \brief Queries the number of bytes in the extensions string. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_CONTEXT_EXTENSIONS_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x6,
+    /*! \brief Retrieves the extensions string. Read-only.
+     * This is a space-separated string of extension names. Each OpenVX official extension has a unique identifier,
+     * comprised of capital letters, numbers and the underscore character, prefixed with "KHR_", for example "KHR_NEW_FEATURE".
+     * Use a <tt>\ref vx_char</tt> pointer allocated to the size returned from <tt>\ref VX_CONTEXT_EXTENSIONS_SIZE</tt>.
+     */
+    VX_CONTEXT_EXTENSIONS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x7,
+    /*! \brief The maximum width or height of a convolution matrix.
+     * Read-only. Use a <tt>\ref vx_size</tt> parameter.
+     * Each vendor must support centered kernels of size w X h, where both w
+     * and h are odd numbers, 3 <= w <= n and 3 <= h <= n, where n is the value of the
+     * <tt>\ref VX_CONTEXT_CONVOLUTION_MAX_DIMENSION</tt> attribute. n is an odd
+     * number that should not be smaller than 9. w and h may or may not be equal to
+     * each other. All combinations of w and h meeting the conditions above must be
+     * supported. The behavior of <tt>\ref vxCreateConvolution</tt> is undefined for values
+     * larger than the value returned by this attribute.
+     */
+    VX_CONTEXT_CONVOLUTION_MAX_DIMENSION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x8,
+    /*! \brief The maximum window dimension of the OpticalFlowPyrLK kernel. The value of this attribute shall be equal to or greater than '9'.
+     * \see <tt>\ref VX_KERNEL_OPTICAL_FLOW_PYR_LK</tt>. Read-only. Use a <tt>\ref vx_size</tt> parameter.
+     */
+    VX_CONTEXT_OPTICAL_FLOW_MAX_WINDOW_DIMENSION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x9,
+    /*! \brief The border mode for immediate mode functions.
+     * \details Graph mode functions are unaffected by this attribute. Read-write. Use a pointer to a <tt>\ref vx_border_t</tt> structure as parameter.
+     * \note The assumed default value for immediate mode functions is <tt>\ref VX_BORDER_UNDEFINED</tt>.
+     */
+    VX_CONTEXT_IMMEDIATE_BORDER = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xA,
+    /*! \brief Returns the table of all unique the kernels that exist in the context.
+     *  Read-only. Use a <tt>\ref vx_kernel_info_t</tt> array.
+     * \pre You must call <tt>\ref vxQueryContext</tt> with <tt>\ref VX_CONTEXT_UNIQUE_KERNELS</tt>
+     * to compute the necessary size of the array.
+     */
+    VX_CONTEXT_UNIQUE_KERNEL_TABLE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xB,
+    /*! \brief The unsupported border mode policy for immediate mode functions. Read-Write.
+     * \details Graph mode functions are unaffected by this attribute. Use a <tt>\ref vx_enum</tt> as parameter. Will contain a <tt>\ref vx_border_policy_e</tt>.
+     * \note The assumed default value for immediate mode functions is <tt>\ref VX_BORDER_POLICY_DEFAULT_TO_UNDEFINED</tt>. Users should refer to the documentation of their implementation to determine what border modes are supported by each kernel.
+     */
+    VX_CONTEXT_IMMEDIATE_BORDER_POLICY = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xC,
+    /*! \brief The dimension of the largest nonlinear filter supported. See <tt>\ref vxNonLinearFilterNode</tt>.
+     * \details The implementation must support all dimensions (height or width, not necessarily the same)
+     * up to the value of this attribute.  The lowest value that must be supported for this attribute is 9.
+     * Read-only. Use a <tt>\ref vx_size</tt> parameter.
+     */
+    VX_CONTEXT_NONLINEAR_MAX_DIMENSION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xd,
+    /*! \brief tensor Data maximal number of dimensions supported by the implementation. */
+    VX_CONTEXT_MAX_TENSOR_DIMS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xE,
+};
+
+/*! \brief The kernel attributes list
+ * \ingroup group_kernel
+ */
+enum vx_kernel_attribute_e {
+    /*! \brief Queries a kernel for the number of parameters the kernel
+     * supports. Read-only. Use a <tt>\ref vx_uint32</tt> parameter.
+     */
+    VX_KERNEL_PARAMETERS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x0,
+    /*! \brief Queries the name of the kernel. Not settable.
+     *  Read-only. Use a <tt>\ref vx_char</tt>[<tt>\ref VX_MAX_KERNEL_NAME</tt>] array (not a <tt>\ref vx_array</tt>).
+     */
+    VX_KERNEL_NAME = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x1,
+    /*! \brief Queries the enum of the kernel. Not settable.
+     *  Read-only. Use a <tt>\ref vx_enum</tt> parameter.
+     */
+    VX_KERNEL_ENUM = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x2,
+    /*! \brief The local data area allocated with each kernel when it becomes a
+     * node.  Read-write. Can be written only before user-kernel finalization.
+     * Use a <tt>\ref vx_size</tt> parameter.
+     * \note If not set it will default to zero.
+     */
+    VX_KERNEL_LOCAL_DATA_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x3,
+};
+
+/*! \brief The kernel object attributes for global and local memory.
+* \ingroup group_kernel
+*/
+enum vx_kernel_attribute_memory_e {
+	/*! \brief The global data pointer size to be shared across all instances of
+	* the kernel (nodes are instances of kernels).
+	* Use a \ref vx_size parameter.
+	* \note If not set it will default to zero.
+	*/
+	VX_KERNEL_GLOBAL_DATA_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x5,
+	/*! \brief The global data pointer to the shared across all the instances of
+	* the kernel (nodes are instances of the kernels).
+	* Use a \ref void * parameter.
+	*/
+	VX_KERNEL_GLOBAL_DATA_PTR = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x6,
+};
+
+/*! \brief The node attributes list.
+ * \ingroup group_node
+ */
+enum vx_node_attribute_e {
+    /*! \brief Queries the status of node execution. Read-only. Use a <tt>\ref vx_status</tt> parameter. */
+    VX_NODE_STATUS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x0,    
+    /*! \brief Indicates the number of node parameters, including optional parameters that are not passed.
+     * Read-only. Use a <tt>\ref vx_uint32</tt> parameter.
+     */
+    VX_NODE_PARAMETERS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x5,
+    /*! \brief Indicates whether the node is replicated. Read-only.
+     * Use a <tt>\ref vx_bool</tt> parameter.
+     */
+    VX_NODE_IS_REPLICATED = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x6,
+    /*! \brief Indicates the replicated parameters. Read-only.
+     * Use a <tt>\ref vx_bool</tt>* parameter.
+     */
+    VX_NODE_REPLICATE_FLAGS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x7,
+};
+
+/*! \brief The parameter attributes list
+ * \ingroup group_parameter
+ */
+enum vx_parameter_attribute_e {
+    /*! \brief Queries a parameter for its index value on the kernel with which it is associated. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_PARAMETER_INDEX = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x0,
+    /*! \brief Queries a parameter for its direction value on the kernel with which it is associated. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_PARAMETER_DIRECTION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x1,
+    /*! \brief Queries a parameter for its type, \ref vx_type_e is returned. Read-only. The size of the parameter is implied for plain data objects. For opaque data objects like images and arrays a query to their attributes has to be called to determine the size. */
+    VX_PARAMETER_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x2,
+    /*! \brief Queries a parameter for its state. A value in <tt>\ref vx_parameter_state_e</tt> is returned. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_PARAMETER_STATE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x3,
+    /*! \brief Use to extract the reference contained in the parameter. Read-only. Use a <tt>\ref vx_reference</tt> parameter.  */
+    VX_PARAMETER_REF = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x4,
+};
+
+
+/*! \brief The scalar attributes list.
+ * \ingroup group_scalar
+ */
+enum vx_scalar_attribute_e {
+    /*! \brief Queries the type of atomic that is contained in the scalar. Read-only. Use a <tt>\ref vx_enum</tt> parameter.*/
+    VX_SCALAR_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_SCALAR) + 0x0,
+};
+
+/*! \brief A type of operation in which both operands are scalars.
+ * \see group_scalar
+ * \ingroup group_scalar
+ */
+enum vx_scalar_operation_e {
+    /*! \brief logical and. */
+    VX_SCALAR_OP_AND = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x0,
+    /*! \brief logical or. */
+    VX_SCALAR_OP_OR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x1,
+    /*! \brief logical exclusive or. */
+    VX_SCALAR_OP_XOR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x2,
+    /*! \brief logical nand. */
+    VX_SCALAR_OP_NAND = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x3,  
+    /*! \brief comparison (equal). */
+    VX_SCALAR_OP_EQUAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x4,
+    /*! \brief comparison (not equal). */
+    VX_SCALAR_OP_NOTEQUAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x5,
+    /*! \brief comparison (less than). */
+    VX_SCALAR_OP_LESS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x6,
+    /*! \brief comparison (less than or equal to). */
+    VX_SCALAR_OP_LESSEQ = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x7,  
+    /*! \brief comparison (greater than). */
+    VX_SCALAR_OP_GREATER = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x8,
+    /*! \brief comparison (greater than or equal to). */
+    VX_SCALAR_OP_GREATEREQ = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x9,  
+    /*! \brief arithmetic addition. */
+    VX_SCALAR_OP_ADD = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xA,  
+    /*! \brief arithmetic subtraction. */
+    VX_SCALAR_OP_SUBTRACT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xB,
+    /*! \brief arithmetic multiplication. */
+    VX_SCALAR_OP_MULTIPLY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xC,
+    /*! \brief arithmetic division. */
+    VX_SCALAR_OP_DIVIDE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xD,
+    /*! \brief arithmetic (modulo operator). */
+    VX_SCALAR_OP_MODULUS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xE,  
+    /*! \brief minimum of two scalars. */
+    VX_SCALAR_OP_MIN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xF,
+    /*! \brief maximum of two scalars. */
+    VX_SCALAR_OP_MAX = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x10,      
+};
+
+/*! \brief tensor Data attributes.
+ * \ingroup group_object_tensor
+ */
+enum vx_tensor_attribute_e
+{
+    /*! \brief Number of dimensions. */
+    VX_TENSOR_NUMBER_OF_DIMS = VX_ATTRIBUTE_BASE( VX_ID_KHRONOS, VX_TYPE_TENSOR ) + 0x0,
+    /*! \brief Dimension sizes. */
+    VX_TENSOR_DIMS        = VX_ATTRIBUTE_BASE( VX_ID_KHRONOS, VX_TYPE_TENSOR ) + 0x1,
+    /*! \brief tensor Data element data type. <tt>vx_type_e</tt> */
+    VX_TENSOR_DATA_TYPE   = VX_ATTRIBUTE_BASE( VX_ID_KHRONOS, VX_TYPE_TENSOR ) + 0x2,
+};
+
+/*! \brief The meta valid rectangle attributes.
+ * \ingroup group_user_kernels
+ */
+enum vx_meta_valid_rect_attribute_e {
+    /*! \brief Valid rectangle callback during output parameter validation. Write-only. */
+    VX_VALID_RECT_CALLBACK = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_META_FORMAT) + 0x1,
+};
+
+/*! \brief An enumeration of memory import types.
+ * \ingroup group_context
+ */
+enum vx_memory_type_e {
+    /*! \brief For memory allocated through OpenVX, this is the import type. */
+    VX_MEMORY_TYPE_NONE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_MEMORY_TYPE) + 0x0,
+
+    /*! \brief The default memory type to import from the Host. */
+    VX_MEMORY_TYPE_HOST = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_MEMORY_TYPE) + 0x1,
+
+    /*! \brief The default memory type to import from the Device. */
+    VX_MEMORY_TYPE_DEVICE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_MEMORY_TYPE) + 0x2,
+};
+
+/*! \brief The parameter state type.
+ * \ingroup group_parameter
+ */
+enum vx_parameter_state_e {
+    /*! \brief Default. The parameter must be supplied. If not set, during
+     * Verify, an error is returned.
+     */
+    VX_PARAMETER_STATE_REQUIRED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_PARAMETER_STATE) + 0x0,
+    /*! \brief The parameter may be unspecified. The kernel takes care not
+     * to deference optional parameters until it is certain they are valid.
+     */
+    VX_PARAMETER_STATE_OPTIONAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_PARAMETER_STATE) + 0x1,
+};
+
+/*! \brief The delay attribute list.
+ * \ingroup group_delay
+ */
+enum vx_delay_attribute_e {
+    /*! \brief The type of objects in the delay. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_DELAY_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DELAY) + 0x0,
+    /*! \brief The number of items in the delay. Read-only. Use a <tt>\ref vx_size</tt> parameter.*/
+    VX_DELAY_SLOTS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DELAY) + 0x1,
+};
+
+/*! \brief The memory accessor hint flags.
+ * These enumeration values are used to indicate desired \e system behavior,
+ * not the \b User intent. For example: these can be interpretted as hints to the
+ * system about cache operations or marshalling operations.
+ * \ingroup group_context
+ */
+enum vx_accessor_e {
+    /*! \brief The memory shall be treated by the system as if it were read-only.
+     * If the User writes to this memory, the results are implementation defined.
+     */
+    VX_READ_ONLY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACCESSOR) + 0x1,
+    /*! \brief The memory shall be treated by the system as if it were write-only.
+     * If the User reads from this memory, the results are implementation defined.
+     */
+    VX_WRITE_ONLY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACCESSOR) + 0x2,
+    /*! \brief The memory shall be treated by the system as if it were readable and writeable.
+     */
+    VX_READ_AND_WRITE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACCESSOR) + 0x3,
+};
+
+/*! \brief The Round Policy Enumeration.
+ * \ingroup group_context
+ */
+enum vx_round_policy_e {
+    /*! \brief When scaling, this truncates the least significant values that are lost in operations. */
+    VX_ROUND_POLICY_TO_ZERO = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ROUND_POLICY) + 0x1,
+    /*! \brief When scaling, this rounds to nearest even output value. */
+    VX_ROUND_POLICY_TO_NEAREST_EVEN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ROUND_POLICY) + 0x2,
+};
+
+/*! \brief Local binary pattern supported.
+ * \ingroup group_vision_function_lbp
+ */
+enum vx_lbp_format_e
+{
+    /*! \brief local binary pattern 
+	*/
+    VX_LBP  = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_LBP_FORMAT ) + 0x0,
+    /*! \brief Modified Local Binary Patterns
+	*/
+	
+    VX_MLBP = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_LBP_FORMAT ) + 0x1,
+    /*! \brief Uniform local binary pattern 
+	*/
+    VX_ULBP = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_LBP_FORMAT ) + 0x2
+};
+
+#if defined(_WIN32) || defined(UNDER_CE)
+#if defined(_WIN64)
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_REF  "%I64u"
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_SIZE "%I64u"
+#else
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_REF  "%lu"
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_SIZE "%lu"
+#endif
+#else
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_REF  "%p"
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_SIZE "%zu"
+#endif
+/*! \brief Use to indicate the 1:1 ratio in Q22.10 format.
+ * \ingroup group_basic_features
+ */
+#define VX_SCALE_UNITY (1024u)
+
+/*! \brief The Kernel Information Structure. This is returned by the Context
+ * to indicate which kernels are available in the OpenVX implementation.
+ * \ingroup group_kernel
+ */
+typedef struct _vx_kernel_info_t {
+    /*! \brief The kernel enumeration value from <tt>\ref vx_kernel_e</tt> (or an
+     * extension thereof).
+     * \see vxGetKernelByEnum
+     */
+    vx_enum enumeration;
+
+    /*! \brief The kernel name in dotted hierarchical format.
+     * e.g. "org.khronos.openvx.sobel_3x3"
+     * \see vxGetKernelByName
+     */
+    vx_char name[VX_MAX_KERNEL_NAME];
+} vx_kernel_info_t;
+
+/*! \brief Use to indicate a half-scale pyramid.
+ * \ingroup group_pyramid
+ */
+#define VX_SCALE_PYRAMID_HALF       (0.5f)
+
+/*! \brief Use to indicate a ORB scaled pyramid whose scaling factor is \f$ \frac{1}{\root 4 \of {2}} \f$.
+ * \ingroup group_pyramid
+ */
+#define VX_SCALE_PYRAMID_ORB        ((vx_float32)0.8408964f)
+
+/*!
+* \brief The type of the <tt>vxPublishKernels</tt> entry function of modules loaded
+* by <tt>\ref vxLoadKernels</tt> and unloaded by <tt>\ref vxUnloadKernels</tt>.
+* \param [in] context The reference to the context kernels must be added to.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_API_CALL *vx_publish_kernels_f)(vx_context context);
+
+/*!
+* \brief The type of the <tt>vxUnpublishKernels</tt> entry function of modules loaded
+* by <tt>\ref vxLoadKernels</tt> and unloaded by <tt>\ref vxUnloadKernels</tt>.
+* \param [in] context The reference to the context kernels have been added to.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_API_CALL *vx_unpublish_kernels_f)(vx_context context);
+
+/*!
+* \brief The pointer to the Host side kernel.
+* \param [in] node The handle to the node that contains this kernel.
+* \param [in] parameters The array of parameter references.
+* \param [in] num The number of parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_f)(vx_node node, const vx_reference *parameters, vx_uint32 num);
+
+/*!
+* \brief The pointer to the kernel initializer. If the host code requires a call
+* to initialize data once all the parameters have been validated, this function is called
+* if not NULL.
+* \param [in] node The handle to the node that contains this kernel.
+* \param [in] parameters The array of parameter references.
+* \param [in] num The number of parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_initialize_f)(vx_node node, const vx_reference *parameters, vx_uint32 num);
+
+/*!
+* \brief The pointer to the kernel deinitializer. If the host code requires a call
+* to deinitialize data during a node garbage collection, this function is called
+* if not NULL.
+* \param [in] node The handle to the node that contains this kernel.
+* \param [in] parameters The array of parameter references.
+* \param [in] num The number of parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_deinitialize_f)(vx_node node, const vx_reference *parameters, vx_uint32 num);
+
+typedef vx_status(VX_CALLBACK *vx_kernel_dump_f)(vx_node node, const vx_reference * parameters, vx_uint32 num, void * info_file);
+
+/*!
+* \brief The user-defined kernel node parameters validation function. The function only
+* needs to fill in the meta data structure(s).
+* \note This function is called once for whole set of parameters.
+* \param [in] node The handle to the node that is being validated.
+* \param [in] parameters The array of parameters to be validated.
+* \param [in] num Number of parameters to be validated.
+* \param [in] metas A pointer to a pre-allocated array of structure references that the system holds.
+* The system pre-allocates a number of vx_meta_format structures for the output parameters only,
+* indexed by the same indices as parameters[]. The validation function fills in the correct type, format,
+* and dimensionality for the system to use either to create memory or to check against existing memory.
+* \return An error code describing the validation status on parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_validate_f)(vx_node node, const vx_reference parameters[], vx_uint32 num, vx_meta_format metas[]);
+
+#endif

+ 67 - 0
include/VX/vx_vendors.h

@@ -0,0 +1,67 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_VENDORS_H_
+#define _OPENVX_VENDORS_H_
+
+/*!
+ * \file
+ * \brief The Vendor ID list for OpenVX.
+ */
+
+/*! \brief The Vendor ID of the Implementation. As new vendors submit their
+ * implementations, this enumeration will grow.
+ * \ingroup group_basic_features
+ */
+enum vx_vendor_id_e {
+    VX_ID_KHRONOS   = 0x000, /*!< \brief The Khronos Group */
+    VX_ID_TI        = 0x001, /*!< \brief Texas Instruments, Inc. */
+    VX_ID_QUALCOMM  = 0x002, /*!< \brief Qualcomm, Inc. */
+    VX_ID_NVIDIA    = 0x003, /*!< \brief NVIDIA Corporation */
+    VX_ID_ARM       = 0x004, /*!< \brief ARM Ltd. */
+    VX_ID_BDTI      = 0x005, /*!< \brief Berkley Design Technology, Inc. */
+    VX_ID_RENESAS   = 0x006, /*!< \brief Renasas Electronics */
+    VX_ID_VIVANTE   = 0x007, /*!< \brief Vivante Corporation */
+    VX_ID_XILINX    = 0x008, /*!< \brief Xilinx Inc. */
+    VX_ID_AXIS      = 0x009, /*!< \brief Axis Communications */
+    VX_ID_MOVIDIUS  = 0x00A, /*!< \brief Movidius Ltd. */
+    VX_ID_SAMSUNG   = 0x00B, /*!< \brief Samsung Electronics */
+    VX_ID_FREESCALE = 0x00C, /*!< \brief Freescale Semiconductor */
+    VX_ID_AMD       = 0x00D, /*!< \brief Advanced Micro Devices */
+    VX_ID_BROADCOM  = 0x00E, /*!< \brief Broadcom Corporation */
+    VX_ID_INTEL     = 0x00F, /*!< \brief Intel Corporation */
+    VX_ID_MARVELL   = 0x010, /*!< \brief Marvell Technology Group Ltd. */
+    VX_ID_MEDIATEK  = 0x011, /*!< \brief MediaTek, Inc. */
+    VX_ID_ST        = 0x012, /*!< \brief STMicroelectronics */
+    VX_ID_CEVA      = 0x013, /*!< \brief CEVA DSP */
+    VX_ID_ITSEEZ    = 0x014, /*!< \brief Itseez, Inc. */
+    VX_ID_IMAGINATION=0x015, /*!< \brief Imagination Technologies */
+    VX_ID_NXP       = 0x016, /*!< \brief NXP Semiconductors */
+    VX_ID_VIDEANTIS = 0x017, /*!< \brief Videantis */
+    VX_ID_SYNOPSYS  = 0x018, /*!< \brief Synopsys */
+    VX_ID_CADENCE   = 0x019, /*!< \brief Cadence */
+    VX_ID_HUAWEI    = 0x01A, /*!< \brief Huawei */
+    VX_ID_SOCIONEXT = 0x01B, /*!< \brief Socionext */
+    /* Add new vendor code above this line */
+    VX_ID_USER      = 0xFFE, /*!< \brief For use by vxAllocateUserKernelId and vxAllocateUserKernelLibraryId */
+    VX_ID_MAX       = 0xFFF,
+    /*! \brief For use by all Kernel authors until they can obtain an assigned ID. */
+    VX_ID_DEFAULT = VX_ID_MAX,
+};
+
+#endif
+

+ 108 - 0
include/VX_EXT/vx_amd_nn.h

@@ -0,0 +1,108 @@
+/* 
+Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
+ 
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+ 
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+ 
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+
+#ifndef _VX_AMD_NN_H_
+#define _VX_AMD_NN_H_
+
+#include <VX/vx.h>
+#include <VX/vx_khr_nn.h>
+#include <vx_ext_amd.h>
+
+/*! \brief [Graph] Creates a Scale Layer Node.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [in] inputs The scale tensor data.
+ * \param [in] inputs The bias tensor data.
+ * \param [out] outputs The output tensor data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxScaleLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor inputs, vx_tensor scale, vx_tensor bias, vx_tensor output);
+
+/*! \brief [Graph] Creates a Concat Layer Node.
+ * \param [in] graph The handle to the graph.
+ * \param [out] outputs The output tensor data.
+ * \param [in] inputs The input 1 tensor data.
+ * \param [in] inputs The input 2 tensor data.
+ * \param [in] inputs The input 3 tensor data.
+ * \param [in] inputs The input 4 tensor data.
+ * \param [in] inputs The input 5 tensor data.
+ * \param [in] inputs The input 6 tensor data.
+ * \param [in] inputs The input 7 tensor data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxConcatLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_size axis, vx_tensor_array_t * input_tensors, vx_size size_of_input_tensors, vx_tensor output);
+
+/*! \brief [Graph] Creates a Slice Layer Node.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] inputs The output 1 tensor data.
+ * \param [out] inputs The output 2 tensor data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+//VX_API_ENTRY vx_node VX_API_CALL vxSliceLayer(vx_graph graph, vx_tensor input, vx_tensor output1, vx_tensor output2, vx_tensor output3, vx_tensor output4, vx_tensor output5, vx_tensor output6, vx_tensor output7, vx_tensor output8);
+VX_API_ENTRY vx_node VX_API_CALL vxSliceLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor input, vx_size axis, vx_tensor_array_t * output_tensors, vx_size size_of_output_tensors);
+
+/*! \brief [Graph] Creates a Convolutional Network Upsampling Layer Node.
+ * \details Upsampling is done on the width and height dimensions of the <tt>\ref vx_tensor</tt>. Therefore, we use here the term x for the width dimension and y for the height dimension.\n
+ * The Upsampling accept input images as tensors of several types. They always output resized images as float32 tensors.
+ * This function supports 4D and 3D tensors as input and output. 4D tensors are for batches of images, 3D tensors for individual images.
+ * Upsampling use resize method NEAREST_NEIGHBOR.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input. Output tensor data type must be same as the inputs. The width and height dimensions of output must be integer multiple of input. The batch and channel dimensions of output and input must be same.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxUpsampleLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor input, vx_tensor output);
+
+/*! \brief [Graph] Creates a Convolutional Network Reshape Layer Node.
+ * \details Reshaping is done with alias if available (output tensor will point to input tensor memory). Otherwise it will do a copy.\n
+ * This function supports 4D tensors as input and output.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input. Output tensor data type must be same as the inputs. The width and height dimensions of output must be integer multiple of input. The batch and channel dimensions of output and input must be same.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxReshapeLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor input, vx_tensor output);
+VX_API_ENTRY vx_node VX_API_CALL vxExecuteLayerDummy(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxEndLayerDummy(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxSyncLayerDummy(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxPermuteLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor inputs, const vx_nn_permute_params_t* permute_params, vx_size size_of_permute_params, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxDummyDataLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxCropLayer(vx_graph graph, vx_tensor inputs1, vx_tensor inputs2, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxSplitLayer(vx_graph graph, const vx_char* name, vx_size name_len, vx_tensor input, vx_tensor_array_t * output_tensors, vx_size size_of_output_tensors);
+VX_API_ENTRY vx_node VX_API_CALL vxCustomLayer(vx_graph graph, vx_tensor_array_t* input_tensors, vx_size size_of_input_tensors, const vx_char * type, vx_nn_custom_params_t* custom_params, vx_size size_of_custom_params, vx_tensor_array_t* output_tensors, vx_size size_of_output_tensors);
+typedef void (*custom_layer_callback)(std::vector<vx_tensor>& input_tensors, std::vector<vx_float32>& custom_params, std::vector<vx_tensor>& output_tensors);
+VX_API_ENTRY vx_status VX_API_CALL vxRegisterCustomLayerCallback(vx_context context, const char* name, custom_layer_callback callback);
+VX_API_ENTRY vx_status VX_API_CALL vxUnRegisterCustomLayerCallBack(vx_context context, const char* name);
+
+#endif

+ 268 - 0
include/VX_EXT/vx_ext_amd.h

@@ -0,0 +1,268 @@
+/* 
+Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
+ 
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+ 
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+ 
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+
+#ifndef _VX_EXT_AMD_H_
+#define _VX_EXT_AMD_H_
+
+#include <VX/vx.h>
+#include <VX/vx_khr_nn.h>
+#ifdef __cplusplus
+#include <string>
+#include <vector>
+#include <map>
+#endif
+
+/*! \brief AMD internal parameters. [TODO: This needs to be moved to ago_internal.h]
+*/
+#define AGO_MAX_PARAMS                                    8
+#define AGO_MERGE_RULE_MAX_FIND                           4
+#define AGO_MERGE_RULE_MAX_REPLACE                        4
+#define AGO_MERGE_RULE_SOLITARY_FLAG                   0x20
+
+/*! \brief Maximum size of scalar string buffer. The local buffers used for accessing scalar strings 
+* should be of size VX_MAX_STRING_BUFFER_SIZE_AMD and the maximum allowed string length is
+* VX_MAX_STRING_BUFFER_SIZE_AMD-1.
+* \ingroup group_scalar
+*/
+#define VX_MAX_STRING_BUFFER_SIZE_AMD                   128
+
+/*! \brief The Neural Network activation functions vx_nn_activation_function_e extension.
+ */
+#define VX_NN_ACTIVATION_LEAKY_RELU  (VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x9)
+
+/*! \brief The type enumeration lists all the AMD specific types in OpenVX.
+*/
+enum ago_type_public_e {
+	/*! \brief AMD data types
+	*/
+	VX_TYPE_FLOAT16             = 0x00F,                     // 16-bit float data type
+	VX_TYPE_STRING_AMD          = 0x011,                     // scalar data type for string
+
+};
+
+/*! \brief The AMD context attributes list.
+*/
+enum vx_context_attribute_amd_e {
+	/*! \brief set a text macro definition. Use a <tt>\ref AgoContextMacroInfo</tt> parameter.*/
+	VX_CONTEXT_ATTRIBUTE_AMD_SET_TEXT_MACRO = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x03,
+	/*! \brief set a merge rule. Use a <tt>\ref AgoNodeMergeRule</tt> parameter.*/
+	VX_CONTEXT_ATTRIBUTE_AMD_SET_MERGE_RULE = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x04,
+	/*! \brief tensor Data max num of dimensions supported by HW. */
+	VX_CONTEXT_MAX_TENSOR_DIMENSIONS = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x05,
+};
+
+/*! \brief The AMD kernel attributes list.
+*/
+enum vx_kernel_attribute_amd_e {
+	/*! \brief kernel callback for node regeneration. Use a <tt>\ref amd_kernel_node_regen_callback_f</tt> parameter.*/
+	VX_KERNEL_ATTRIBUTE_AMD_NODE_REGEN_CALLBACK     = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_KERNEL) + 0x03,
+};
+
+/*! \brief The AMD graph attributes list.
+*/
+enum vx_graph_attribute_amd_e {
+	/*! \brief graph optimizer flags. Use a <tt>\ref vx_uint32</tt> parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_OPTIMIZER_FLAGS              = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x04,
+};
+
+/*! \brief tensor Data attributes.
+* \ingroup group_tensor
+*/
+enum vx_tensor_attribute_amd_e {
+	VX_TENSOR_MEMORY_TYPE			= VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0x8,
+	VX_TENSOR_MEMORY_HANDLE			= VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0x9,
+	VX_TENSOR_MEMORY_PHYS_ADDR		= VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0xa,
+	VX_TENSOR_MEMORY_VIRT_ADDR		= VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0xb,
+	VX_TENSOR_MEMORY_SIZE			= VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0xc,
+	VX_TENSOR_FIXED_POINT_POSITION	= VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0xd,
+};
+
+/*! \brief The image color space list used by the <tt>\ref VX_IMAGE_SPACE</tt> attribute of a <tt>\ref vx_image</tt>.
+* \ingroup group_image
+*/
+enum vx_color_space_amd_e {
+	/*! \brief Use to indicate that the BT.2020 coefficients are used for conversions. */
+	VX_COLOR_SPACE_BT2020 = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_COLOR_SPACE) + 0x1,
+};
+
+enum vx_action_vpu_e {
+	VX_ACTION_VPU_RSZ = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_ACTION) + 0x10,
+	VX_ACTION_VPU_MBG = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_ACTION) + 0x11,
+};
+
+/*! \brief The multidimensional data object (Tensor).
+* \see vxCreateTensor
+* \ingroup group_tensor
+* \extends vx_reference
+*/
+typedef struct _vx_tensor_t * vx_tensor;
+
+/*! \brief AMD data structure to set a text macro.
+*/
+typedef struct {
+	vx_char macroName[256];
+	vx_char * text;
+} AgoContextTextMacroInfo;
+
+/*! \brief AMD data structure to import a graph from a text.
+**    text:
+**      "macro <macro-name>" to use a pre-defined macro
+**      "file <file-name>" to load from a file
+**      otherwise use the text as is
+*/
+typedef struct {
+	vx_char * text;
+	vx_uint32 num_ref;
+	vx_reference * ref;
+	vx_int32 dumpToConsole;
+	void (VX_CALLBACK * data_registry_callback_f) (void * obj, vx_reference ref, const char * name, const char * app_params);
+	void * data_registry_callback_obj;
+} AgoGraphImportInfo;
+
+/*! \brief AMD data structure to export a graph to a text.
+*/
+typedef struct {
+	vx_char fileName[256];
+	vx_uint32 num_ref;
+	vx_reference * ref;
+	vx_char comment[64];
+} AgoGraphExportInfo;
+
+/*! \brief AMD data structure to get internal performance data.
+*/
+typedef struct {
+	vx_uint64 kernel_enqueue;
+	vx_uint64 kernel_wait;
+	vx_uint64 buffer_read;
+	vx_uint64 buffer_write;
+} AgoGraphPerfInternalInfo;
+
+/*! \brief AMD data structure to specify node merge rule.
+*/
+typedef struct AgoNodeMergeRule_t {
+	struct {
+		vx_enum    kernel_id;
+		vx_uint32  arg_spec[AGO_MAX_PARAMS];
+	} find[AGO_MERGE_RULE_MAX_FIND];
+	struct {
+		vx_enum    kernel_id;
+		vx_uint32  arg_spec[AGO_MAX_PARAMS];
+	} replace[AGO_MERGE_RULE_MAX_REPLACE];
+} AgoNodeMergeRule;
+
+
+#ifdef __cplusplus
+
+/*! \brief AMD usernode callback for regenerating a node.
+*/
+typedef vx_status(VX_CALLBACK * amd_drama_add_node_f)(vx_node node, vx_enum kernel_id, vx_reference * paramList, vx_uint32 paramCount);
+typedef vx_status(VX_CALLBACK * amd_kernel_node_regen_callback_f)(vx_node node, amd_drama_add_node_f add_node_f, vx_bool& replace_original);
+
+#endif
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/**
+* \brief Retrieve the name of a reference
+* \ingroup vx_framework_reference
+*
+* This function is used to retrieve the name of a reference.
+*
+* \param [in] ref The reference.
+* \param [out] name Pointer to copy the name of the reference.
+* \param [in] size Size of the name buffer.
+* \return A \ref vx_status_e enumeration.
+* \retval VX_SUCCESS No errors.
+* \retval VX_ERROR_INVALID_REFERENCE if reference is not valid.
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxGetReferenceName(vx_reference ref, vx_char name[], vx_size size);
+
+/* Tensor */
+VX_API_ENTRY vx_tensor VX_API_CALL vxCreateGraphTensorFromHandle(vx_graph graph, vx_size number_of_dims, const vx_size* dims, vx_enum data_type, vx_int8 fixed_point_position, const vx_size* stride, void* ptr, vx_enum memory_type);
+
+/* extend for nna device */
+VX_API_ENTRY vx_graph VX_API_CALL vxGetScopeGraph(vx_reference reference);
+VX_API_ENTRY vx_bool VX_API_CALL vxGraphProfEnable(vx_graph graph);
+VX_API_ENTRY vx_size VX_API_CALL vxAllocateDeviceMemory(vx_context context, vx_size size);
+VX_API_ENTRY vx_status VX_API_CALL vxFreeDeviceMemory(vx_context context, vx_size handle);
+VX_API_ENTRY vx_size VX_API_CALL vxGetDeviceMemorySize(vx_size handle);
+VX_API_ENTRY vx_size VX_API_CALL vxGetDeviceMemoryPhysicalAddress(vx_size handle);
+VX_API_ENTRY vx_size VX_API_CALL vxGetDeviceMemoryVirtualAddress(vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxInvalidateDeviceMemoryCache(vx_context context, vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxInvalidateDeviceMemoryCacheAll(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxFlushDeviceMemoryCache(vx_context context, vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxFlushDeviceMemoryCacheAll(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxDeviceMemoryInfo(vx_context context, std::vector<vx_size>& mem_size, std::vector<vx_size>& virt_addr, std::vector<vx_size>& phys_addr);
+
+VX_API_ENTRY vx_status VX_API_CALL vxConfigGraphCommandMemory(vx_graph graph, vx_size handle, vx_bool dynamic_params);
+VX_API_ENTRY vx_status VX_API_CALL vxConfigGraphMemory(vx_graph graph, vx_size wt_handle, bool on_chip_mem, vx_size io_handle_size, vx_size io_handle);
+VX_API_ENTRY vx_int32 VX_API_CALL vxGetGraphInOutMemorySize(vx_graph graph);
+
+VX_API_ENTRY vx_status VX_API_CALL vxConfigInOutSharedMemory(vx_context context, vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxLockInOutSharedMemory(vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxUnLockInOutSharedMemory(vx_graph graph);
+
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphCommandParams(vx_graph graph, std::vector<int>& cmd_offset, std::vector<int>& cmd_length);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphCommandPacketParams(vx_graph graph, int cmd_blk_num, int first_cmd_len, int offset, int length, bool on_chip_mem_enable, bool next_soft_kernel);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphLayerBlockCommandParams(vx_graph graph, std::vector<int>& block_cmd_first, std::vector<int>& block_cmd_count, std::vector<int>& layers_of_block);
+VX_API_ENTRY vx_int32 VX_API_CALL vxGetGraphLayerBlockCount(vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxQueueCommand(vx_context context, vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxProcessCommand(vx_context context, vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxPushGraphSoftBlockPerf(vx_graph graph, int time_eval);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphBlockType(vx_graph graph, int node_type, int block_idx);
+VX_API_ENTRY vx_size VX_API_CALL vxCreateHandleFromDeviceMemory(vx_context context, vx_size offset, vx_size length, vx_size dev_mem_handle);
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseDeviceMemoryHandle(vx_context context, vx_size dev_mem_handle);
+VX_API_ENTRY vx_status VX_API_CALL vxVerifyDeviceMemoryHandle(vx_context context, vx_size dev_mem_handle);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphInputTensor(vx_graph graph, int batch_idx, std::string name, std::vector<int>& dims, std::vector<int>& channels, int align_mode, vx_tensor tensor);
+VX_API_ENTRY vx_status VX_API_CALL vxGetGraphInputBlob(vx_graph graph, std::map<std::string, std::vector<std::vector<void*>>>& input_blobs);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphOutputTensor(vx_graph graph, int batch_idx, bool final_output, std::string name, std::vector<int> & dims, std::vector<int>& channels, int align_mode, vx_tensor tensor);
+VX_API_ENTRY vx_status VX_API_CALL vxGetGraphOutputBlob(vx_graph graph, std::map<std::string, std::vector<std::vector<void*>>>& output_blobs);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphInputBlobPosition(vx_graph graph, std::map<std::string, std::vector<std::pair<int, int>>>& input_data_pos, std::map<std::string, std::vector<std::vector<std::tuple<int, int, int>>>>& input_cmd_pos);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphInputHandle(vx_graph graph, std::string& name, vx_size handle, int batch_idx);
+VX_API_ENTRY vx_status VX_API_CALL vxResetGraphInputHandle(vx_graph graph, std::string& name, int batch_idx);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphQuantizationParam(vx_graph graph, std::string& name, bool qen);
+
+VX_API_ENTRY vx_uint64 VX_API_CALL vxGetSysTime();
+VX_API_ENTRY vx_int32 VX_API_CALL vxGetDeviceID(vx_context context, const vx_char* dev_name);
+VX_API_ENTRY vx_int32 VX_API_CALL vxGetDeviceVersion(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxSetDeviceFreq(vx_context context, const vx_char* dev_name, int freq);
+VX_API_ENTRY vx_status VX_API_CALL vxGetDeviceFreq(vx_context context, const vx_char* dev_name, int* freq);
+VX_API_ENTRY vx_status VX_API_CALL vxSetDeviceTimeOut(vx_context context, const vx_char * dev_name, int timeout);
+VX_API_ENTRY vx_status VX_API_CALL vxGetDeviceTimeOut(vx_context context, const vx_char * dev_name, int * timeout);
+VX_API_ENTRY vx_status VX_API_CALL vxNpuDeviceRun(vx_context context, int cmd_blk_num, int first_cmd_len, int warp_in_align64, vx_size internal_phys_base_addr, vx_size input_phys_base_addr, vx_size output_phys_base_addr, vx_size size_of_cmd, vx_uint32* cmd);
+VX_API_ENTRY vx_status VX_API_CALL vxVpuDeviceRun(vx_context context, vx_enum vpu_op, void* cfgs, vx_size size_of_cfgs);
+VX_API_ENTRY vx_status VX_API_CALL vxProfileGraph(vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxExecuteCommand(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxFinish(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxFlush(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxWaitSync(vx_context context, vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxLockContext(vx_context context);// internal use.
+VX_API_ENTRY vx_status VX_API_CALL vxUnLockContext(vx_context context);// internal use.
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif

+ 30 - 0
include/VX_EXT/vx_log.h

@@ -0,0 +1,30 @@
+#ifndef __VX_LOG_H__
+#define __VX_LOG_H__
+
+#include <stdarg.h>
+#include <VX/vx.h>
+
+#ifdef ALOG_PRINT
+#include <log/log.h>
+#define VX_LOG(...)  ALOGE(__VA_ARGS__)
+#else
+#define VX_LOG(...)  printf(__VA_ARGS__)
+#endif
+
+#define ERROR_CHECK_STATUS( status ) { \
+        vx_status status_ = (status); \
+        if(status_ != VX_SUCCESS) { \
+            VX_LOG("ERROR: failed with status = (%d) at " __FILE__ "#%d\n", status_, __LINE__); \
+            exit(1); \
+        } \
+    }
+
+#define ERROR_CHECK_OBJECT( obj ) { \
+        vx_status status_ = vxGetStatus((vx_reference)(obj)); \
+        if(status_ != VX_SUCCESS) { \
+            VX_LOG("ERROR: failed with status = (%d) at " __FILE__ "#%d\n", status_, __LINE__); \
+            exit(1); \
+        } \
+    }
+
+#endif

+ 35 - 0
include/ansjer_ai_cfg.h

@@ -0,0 +1,35 @@
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <vector>
+#include "tiny_json.h"
+
+#pragma once
+
+typedef struct ClassAttrsAll {
+    float conf_thresh;
+    float iou_thresh;
+}ClassAttrsAll_t;
+
+typedef struct Property {
+    std::string model_type;
+    char ezbStr[128];
+    char binStr[128];
+    
+    unsigned int anchors[18] ;
+    std::vector<std::string> label;
+    std::vector<std::string> yolo_outputs_name;
+    bool need_nu_freq;
+    int freq_nu;
+    bool need_vu_freq;
+    int freq_vu;
+}Property_t;
+
+typedef struct Asj_Ai_Cfg {
+    Property property;
+    ClassAttrsAll class_attrs_all;
+}Asj_Ai_Cfg_t;
+
+int read_Asj_Ai_Json (void *hdl,char *filename);

+ 7 - 0
include/ax_config.h

@@ -0,0 +1,7 @@
+#ifndef _AX_CONFIG_H
+#define _AX_CONFIG_H
+
+#define __VX2021__
+
+
+#endif

+ 32 - 0
include/ax_test_utils.h

@@ -0,0 +1,32 @@
+#ifndef __AX_TEST_UTILS_H__
+#define __AX_TEST_UTILS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "eznn_api.h"
+#ifdef __EOS__
+#include <rtthread.h>
+#include <debug.h>
+#endif
+
+
+int drawrectback(char *y, int w, ezax_rt_t *pRect);
+int drawrectback_c(char *y, int w, ezax_rt_t *pRect, int color);
+int draw_rect_with_color(char *y, int w, int h, ezax_rt_t *pRect, int color);
+void *ax_malloc_uncache(unsigned int *phy_addr, int size);
+int ax_free_uncache(unsigned int phy_addr, void *viraddr);
+void *ax_realloc_virt(void *prt, int size);
+void *ax_malloc_virt(int size);
+int ax_free_virt(void *prt);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif

+ 561 - 0
include/ax_type.h

@@ -0,0 +1,561 @@
+#ifndef _AX_TYPE_H
+#define _AX_TYPE_H
+#include "ax_config.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+
+#define YUV420 YUV420_SP
+#define YVU420 YVU420_SP
+
+
+//#define MALLOC_CHECK
+
+void *AX_MALLOC_RECORD(int size);
+void AX_FREE_RECORD(void *ptr);
+
+void *AX_MALLOC_DEBUG(const char *func, int line, int size);
+void AX_FREE_DEBUG(void *ptr);
+
+void DUMP_AX_MEM_LIST_INFO(int flag);
+void AX_CHECK_MEM_BOUND();
+
+#ifdef MALLOC_CHECK
+#define AX_MALLOC(sz) AX_MALLOC_DEBUG(__func__, __LINE__, sz)
+#define AX_FREE(ptr)  AX_FREE_DEBUG(ptr)
+#else
+#define AX_MALLOC(sz) AX_MALLOC_RECORD(sz)
+#define AX_FREE(ptr)  AX_FREE_RECORD(ptr)
+#endif
+
+#define AX_MALLOC_FAIL_LOG(mem) printf("AX MALLOC "#mem".p fail\n")
+
+template <class T>
+void AX_MALLOC_INC_TEMP(T &mem, int required_size)
+{
+	(mem).size = (required_size);
+	int origin_len_1220 = 0;
+	if((mem).p)
+	{
+		origin_len_1220 = *(((int*)(mem).p) - 1);
+	} 
+	int required_len_1220 = (required_size) * sizeof((mem).p[0]);
+	if(((mem).p == NULL && required_len_1220 > 0) || required_len_1220 > origin_len_1220)
+	{
+		int required_enlarge_len_1220 = required_len_1220 ;
+		if((mem).p)
+		{
+			AX_FREE((mem).p);
+			(mem).p = 0;
+		}
+#ifdef _MSC_VER
+		(mem).p=(decltype((mem).p))AX_MALLOC(required_enlarge_len_1220);
+#else
+		(mem).p = (typeof((mem).p))AX_MALLOC(required_enlarge_len_1220);
+#endif
+		if ((mem).p == NULL)
+		{
+			(mem).size = 0;
+		}
+	}
+}
+
+
+#define AX_MALLOC_INC(mem, type, required_size) AX_MALLOC_INC_TEMP(mem, (required_size))
+
+
+template <class T>
+void AX_MALLOC_INC_2D(T &mem)
+{
+	int required_size = mem.size.width * mem.size.height;
+	int origin_len_1220 = 0;
+	if((mem).p)
+	{
+		origin_len_1220 = *(((int*)(mem).p) - 1);
+	} 
+	int required_len_1220 = (required_size) * sizeof((mem).p[0]);
+	if(((mem).p == NULL && required_len_1220 > 0) || required_len_1220 > origin_len_1220)
+	{
+		int required_enlarge_len_1220 = required_len_1220 ;
+		if((mem).p)
+		{
+			AX_FREE((mem).p);
+			(mem).p = 0;
+		}
+#ifdef _MSC_VER
+		(mem).p=(decltype((mem).p))AX_MALLOC(required_enlarge_len_1220);
+#else
+		(mem).p = (typeof((mem).p))AX_MALLOC(required_enlarge_len_1220);
+#endif
+	}
+}
+
+#ifndef MAX
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+#endif
+#ifndef MIN
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
+#endif
+
+#ifndef ROUND
+#define ROUND(f) (  ((f)>=0)?((int)((f)+0.5)):((int)((f)-0.5)) )
+#endif
+
+#ifndef CLIPMINMAX
+#define CLIPMINMAX(v,mn,mx)				\
+{										\
+		if ((v)<(mn))		{(v)=(mn);}\
+		else if((v)>(mx))	{(v)=(mx);}\
+}
+#endif
+
+
+
+
+template <class T1, class T2>
+T2* ax_buffer_get(T1 &b, int index)
+{
+	if(b.size == 0)
+	{
+		return NULL;
+	}
+	int temp_index = b.cur - b.size + 1 + index;
+	if (temp_index >= 0)
+	{
+		return &b.buffers[temp_index];
+	}
+	else
+	{
+		return &b.buffers[temp_index+b.capacity];
+	}
+}
+template <class T1, class T2>
+T2* ax_buffer_get_back(T1 &b)
+{
+	return ax_buffer_get<T1, T2>(b, b.size-1);
+}
+
+template <class T1, class T2>
+void ax_buffer_push_back(T1 &b, T2 &element)
+{
+	if (b.size == 0) 
+	{
+		b.cur = -1; 
+	} 
+	b.cur++; 
+	if (b.cur >= b.capacity) 
+	{ 
+		b.cur = 0; \
+	} 
+	b.buffers[b.cur] = element; 
+	b.size++; 
+	if (b.size > b.capacity)
+	{
+		b.size = b.capacity;
+	}
+}
+
+template <class T1, class T2>
+T2 *ax_buffer_pop_back(T1 &b)
+{
+	 
+}
+
+
+#define AX_BUFFER_GET(b, type, index) (((b).cur-(b).size+1+index >= 0)?((type*)&(b).buffers[(b).cur-(b).size+1+index]):((type*)&(b).buffers[(b).cur-(b).size+1+index+(b).capacity])) 
+#define AX_BUFFER_PUSH_BACK(b, element) { \
+	if((b).size==0) \
+	{\
+		(b).cur=-1;\
+	} \
+	(b).cur++;\
+	if((b).cur >= (b).capacity) \
+	{ \
+		(b).cur = 0; \
+	} \
+	(b).buffers[(b).cur] = element;\
+	(b).size++; \
+	if((b).size > (b).capacity) \
+		(b).size=(b).capacity; \
+	}\
+
+#define AX_BUFFER_RESET(b) { \
+	(b).cur=-1; \
+	(b).size=0; \
+	}
+
+
+template <class T1>
+void AX_ARRAY_ZERO(T1 &mem)
+{
+	memset(mem.p, 0, sizeof(mem.p[0]) * mem.size);
+}
+
+
+template <class T1, class T2>
+void AX_ARRAY_PUSH_BACK(T1 &mem, T2 &elem)
+{
+	int required_size = mem.size + 1;
+	int origin_len = 0;
+	if(mem.p)
+	{
+		origin_len = *(((int*)(mem).p) - 1);
+	}
+	int required_len = (required_size) * sizeof((mem).p[0]);
+	if(((mem).p == NULL && required_len > 0) || required_len > origin_len)
+	{
+		int required_enlarge_len = required_len * 2;
+		void *temp_ptr = AX_MALLOC(required_enlarge_len);
+
+		if((mem).p)
+		{
+			memcpy(temp_ptr, mem.p, origin_len);
+			AX_FREE(mem.p);
+		}
+#ifdef _MSC_VER
+		mem.p = (decltype((mem).p))temp_ptr;
+#else
+		mem.p=(typeof((mem).p))temp_ptr;
+#endif
+	}
+	mem.p[mem.size] = elem;
+	mem.size = required_size;
+}
+
+template <class T1>
+void AX_ARRAY_CLEAR(T1 &mem)
+{
+	mem.size = 0;
+}
+
+template <class T1>
+void AX_ARRAY_RELEASE(T1 &mem)
+{
+	AX_FREE(mem.p);
+	mem.p = NULL;
+	mem.size = 0;
+}
+
+/*deep copy*/
+template <class T1>
+void AX_ARRAY_COPY(T1 &src, T1 &dst)
+{
+	AX_MALLOC_INC_TEMP(dst, src.size);
+	memcpy(dst.p, src.p, sizeof(src.p[0]) * src.size);
+}
+
+
+
+enum {
+	AX_INT8 = 0,
+	AX_UINT8 = 1,
+	AX_INT16 = 2,
+	AX_UINT16 = 3,
+	AX_INT32 = 4,
+	AX_UINT32 = 5,
+	AX_FLOAT32 = 6,
+	AX_FLOAT64 = 7,
+};
+
+
+#if defined _STDINT || defined __EOS__
+
+#else
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned int uint32_t;
+#endif
+typedef float float32_t;
+typedef double float64_t;
+typedef unsigned short ushort;
+
+
+
+#ifndef _AX_RECT_T
+#define _AX_RECT_T
+typedef struct
+{
+	int x;
+	int y;
+	int width;
+	int height;
+} ax_rect_t;
+#endif
+
+#ifndef _AX_BOX_T
+#define _AX_BOX_T
+typedef struct
+{
+	int x1;
+	int y1;
+	int x2;
+	int y2;
+} ax_box_t;
+#endif
+
+
+#ifndef _AX_SIZE_T
+#define _AX_SIZE_T
+typedef struct
+{
+	int width;
+	int height;
+} ax_size_t;
+#endif
+
+#ifndef _AX_SIZE_F_T
+#define _AX_SIZE_F_T
+typedef struct
+{
+	float width;
+	float height;
+} ax_sizef_t;
+#endif
+
+#ifndef _AX_POINTU16_T
+#define _AX_POINTU16_T
+typedef struct {
+	unsigned short x;
+	unsigned short y;
+} ax_pointu16_t;
+#endif
+
+#ifndef _AX_POINTS16_T
+#define _AX_POINTS16_T
+typedef struct {
+	short x;
+	short y;
+} ax_points16_t;
+#endif
+
+typedef struct
+{
+	ax_points16_t *p;
+	int size;
+} ax_points16_array_t;
+
+#ifndef _AX_POINT_T
+#define _AX_POINT_T
+typedef struct {
+	int x;
+	int y;
+} ax_point_t;
+#endif
+
+
+#ifndef _AX_POINT_2F_T
+#define _AX_POINT_2F_T
+typedef struct {
+	float x;
+	float y;
+} ax_pointf_t;
+#endif
+
+#ifndef _AX_POINT_2D_T
+#define _AX_POINT_2D_T
+typedef struct {
+	double x;
+	double y;
+} ax_pointd_t;
+#endif
+
+#ifndef _AX_POINT_3D_T
+#define _AX_POINT_3D_T
+typedef struct {
+	double x;
+	double y;
+	double z;
+} ax_point3d_t;
+#endif
+
+#ifndef _AX_BBOX_T
+#define _AX_BBOX_T
+typedef struct {
+	int x1;
+	int y1;
+	int x2;
+	int y2;
+} ax_bbox_t;
+#endif
+
+
+#ifndef _AX_YUV_T
+#define _AX_YUV_T
+typedef struct
+{
+	void *y;
+	void *uv;
+	void *y_phy;
+	void *uv_phy;
+	int stride1;
+	int stride2;
+	ax_size_t size;
+	img_fmt format;
+} ax_yuv_t;
+#endif
+
+
+
+#ifndef _AX_INT_ARRAY_T
+#define _AX_INT_ARRAY_T
+typedef struct
+{
+	int *p;
+	int size;
+} ax_int_array_t;
+
+#endif
+
+#ifndef _UINT_ARRAY_T
+#define _UINT_ARRAY_T
+typedef struct
+{
+	unsigned int *p;
+	int size;
+} ax_uint_array_t;
+#endif
+
+
+#ifndef _AX_INT8_ARRAY_T
+#define _AX_INT8_ARRAY_T
+typedef struct
+{
+	int8_t *p;
+	int size;
+} ax_int8_array_t;
+#endif
+
+#ifndef _AX_DOUBLE_ARRAY_T
+#define _AX_DOUBLE_ARRAY_T
+typedef struct
+{
+	double *p;
+	int size;
+} ax_double_array_t;
+#endif
+
+#ifndef _AX_FLOAT_ARRAY_T
+#define _AX_FLOAT_ARRAY_T
+typedef struct
+{
+	float *p;
+	int size;
+} ax_float_array_t;
+#endif
+
+#ifndef _UCHAR_MATRIX_T
+#define _UCHAR_MATRIX_T
+typedef struct
+{
+	unsigned char *p;
+	ax_size_t size;
+} ax_uchar_matrix_t;
+#endif
+
+typedef ax_uchar_matrix_t ax_gray_t;
+
+#ifndef _USHORT_ARRAY_T
+#define _USHORT_ARRAY_T
+typedef struct
+{
+	unsigned short *p;
+	int size;
+} ax_ushort_array_t;
+#endif
+
+
+#ifndef __AX_DETECT_BOX_T_
+#define __AX_DETECT_BOX_T__
+typedef struct
+{
+	int   x1;
+	int   y1;
+	int   x2;
+	int   y2;
+	int   class_idx;
+	int   origin_class_idx;
+	float score;
+} ax_detect_box_t;
+#endif
+
+
+#ifndef __AX_TRACK_BOX_T__
+#define __AX_TRACK_BOX_T__
+typedef struct
+{
+	int   id;
+	int   x1;
+	int   y1;
+	int   x2;
+	int   y2;
+} ax_track_box_t;
+#endif
+
+#ifndef __AX_DETECT_BOX_ARRAY_T__
+#define __AX_DETECT_BOX_ARRAY_T__
+typedef struct
+{
+	ax_detect_box_t *p;
+	int size;
+} ax_detect_box_array_t;
+#endif
+
+
+class ax_tensor_mem_t
+{
+public:
+	ax_tensor_mem_t();
+	ax_tensor_mem_t(int len);
+	void *alloc_mem(int len);
+	~ax_tensor_mem_t();
+
+	void *data;
+	ax_tensor_mem_t(const ax_tensor_mem_t &m);
+	ax_tensor_mem_t& operator = (const ax_tensor_mem_t &m);
+
+	int len;
+private:
+	int *refcount;
+	void release();
+};
+
+class ax_tensor_t
+{
+public:
+	ax_tensor_t();
+	ax_tensor_t(const ax_tensor_t &m);
+	ax_tensor_t(int num, int channel, int row, int col, int dtype);
+	ax_tensor_t(int *dims, int dtype);
+	~ax_tensor_t();
+	int numel();
+	int dims[4];
+	void *data;
+	int  dtype;
+	double fix_scale; /*available only when dtype == INT8 */
+
+	ax_tensor_t convert(int dtype);
+	ax_tensor_t mul(double scale);
+	ax_tensor_t copy();
+	void set_to(double value);
+	void set_fix_scale(double fix_scale);
+	//private:
+	ax_tensor_mem_t mem;
+	void create(int *dims, int dtype);
+	void create(int *dims, int dtype, void *ptr);
+
+	template <typename _Tp> inline _Tp* ptr(int dim0 = 0, int dim1 = 0, int dim2 = 0, int dim3 = 0){
+		int step2 = dims[3];
+		int step1 = dims[2] * step2;
+		int step0 = dims[1] * step1;
+		return (_Tp*)data + dim0 * step0 + dim1 * step1 + dim2 * step2 + dim3;
+	}
+
+	double norm();
+	double dot(ax_tensor_t &t2);
+};
+
+#endif

+ 136 - 0
include/eznn_api.h

@@ -0,0 +1,136 @@
+#ifndef _EZNN_API_H_
+#define _EZNN_API_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifndef MAX_CLASSIFICATION_DET_NUM
+#define MAX_CLASSIFICATION_DET_NUM 256
+#endif
+
+
+typedef enum EzaxImageFormat_e {
+	EZAX_YUV420_SP = 0x02,
+	EZAX_YVU420_SP = 0x04,
+	EZAX_BGRA  = 0x09,
+} ezax_img_fmt_e;
+
+
+typedef struct ezax_imres
+{
+	/* picture resolution */
+	int w; int h;
+}ezax_imres_t;
+
+
+typedef struct ezax_freq
+{
+	/*dev_id; freq*/
+	int id; int freq;
+}ezax_freq_t;
+
+
+typedef struct ezax_rt
+{
+	/* left top */
+	int x0;	int y0;
+	/* right bottom */
+	int x1;	int y1;
+	/* class */
+	int c;
+	/* score */
+	float s;
+	/* id */
+	int id;
+	/* area */
+	int area;
+	/* exit */
+	int exist;
+	/* input extern information such as ezax_face_kpts_t */
+	void *in_ex_inform;
+	/* output extern information*/
+	void *out_ex_inform;
+	/* rsved */
+	int rev;
+}ezax_rt_t;
+
+
+typedef struct ezax_boxes
+{
+	/* roi boxes */
+	ezax_rt_t *pRect;
+	/* rect num */
+	int num;
+	/* */
+	unsigned int nUID;
+	/* rzv inform */
+	void *rzv;
+}ezax_boxes_t;
+
+
+typedef struct ezax_img_handle {
+	/* vir addr*/
+	void *pVir;
+	void *pVir_UV;
+	/* phy addr*/
+	unsigned int pPhy;
+	unsigned int pPhy_UV;
+	/* size */
+	int sz;
+	/* fmt */
+	int fmt;
+	/* iw */
+	int w;
+	/* ih */
+	int h;
+	/* channels */
+	int c;
+	/* wstride */
+	int stride;
+	/* color matrixs */
+	int csc_mode;
+} ezax_img_handle_t;
+
+typedef struct ezax_img
+{
+	/* img_handle */
+	ezax_img_handle_t img_handle;
+	/* valid roi */
+	ezax_rt_t roi;
+	/* input extern information such as ezax_face_kpts_t*/
+	unsigned int nUID;
+	/* reved */
+	unsigned int rzv;
+}ezax_img_t;
+
+
+typedef struct ezax_img_batch
+{
+	/* batch images */
+	ezax_img_t *pImg;
+	/* batch num */
+	unsigned int nNum;
+}ezax_img_batch_t;
+
+
+typedef struct ezax_img_rois
+{
+	/* img_handle */
+	ezax_img_handle_t img_handle;
+	/* valid roi */
+	ezax_rt_t *roi;
+	/* roi num */
+	int roi_num;
+	/* */
+	unsigned int nUID;
+	/* reserved */
+	unsigned int rzv;
+}ezax_img_rois_t;
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif

+ 336 - 0
include/libnn/net_api.h

@@ -0,0 +1,336 @@
+#ifndef _NET_API_H_
+#define _NET_API_H_
+
+#include <vector>
+#include <VX/vx.h>
+#include <vx_ext_amd.h>
+
+typedef enum ImageFormat_E {
+	YUV420_SP = 0x02,
+	YVU420_SP = 0x04,
+	NNA_BGRA  = 0x09,
+	NNA_GRAY  = 0x07,
+} img_fmt;
+
+typedef enum ImageOperation_E {
+	CVT  = 1001,
+	WARP = 1002,
+} img_op;
+
+typedef enum ImageDataLayout_E {
+	CHW = 2001,
+	HWC = 2002,
+	WHC = 2003,
+} img_data_layout;
+
+typedef struct ImageConvertParam_S {
+	img_fmt input_fmt;
+	int input_width;
+	int input_height;
+	int input_crop_x;
+	int input_crop_y;
+	int input_crop_w;
+	int input_crop_h;
+	int input_color_range;
+	img_fmt output_fmt;
+	int output_width;
+	int output_height;
+	int output_crop_x;
+	int output_crop_y;
+	int output_crop_w;
+	int output_crop_h;
+} img_cvt_param;
+
+typedef struct MbgParam_S {
+	int input_width;
+	int input_height;
+	int blk_width;
+	int blk_height;
+	int threshold_enable;
+	int threshold;
+	int alpha;
+	int reset_flag;
+	int mask_threshold;
+} mbg_param;
+
+typedef struct ImageWarpParam_S {
+	img_fmt input_fmt;
+	int input_width;
+	int input_height;
+	int output_width;
+	int output_height;
+	int flip;
+	float mat[6];
+	int output_crop_x;
+	int output_crop_y;
+	int output_crop_w;
+	int output_crop_h;
+} img_warp_param;
+
+typedef struct InputImage_S {
+	img_op op;
+	img_fmt fmt;
+	int width;
+	int height;
+	union {
+		/* crop out params in cvt_param and warp_param struct have been deprecated. */
+		struct {
+			int crop_in_x;
+			int crop_in_y;
+			int crop_in_w;
+			int crop_in_h;
+			int color_range;
+			int crop_out_x;
+			int crop_out_y;
+			int crop_out_w;
+			int crop_out_h;
+		} cvt_param;
+		struct {
+			int flip;
+			int crop_out_x;
+			int crop_out_y;
+			int crop_out_w;
+			int crop_out_h;
+			float mat[6];
+		} warp_param;
+	} u;		
+	vx_size phys_addr;
+	vx_size phys_addr_uv;	
+} input_image;
+
+typedef enum NetDataLayout_E {
+	NCHW = 3001,
+	NHWC = 3002,
+	NWHC = 3003,
+} net_data_layout;
+
+typedef enum NetDataType_E {
+	DINT8    = 4001,
+	DINT16   = 4002,
+	DFLOAT32 = 4003,
+} net_data_type;
+
+typedef struct NetBlobData_S {
+	int n;
+	int c;
+	int h;
+	int w;
+	void* data;
+	bool need_quantize;
+	net_data_type type;
+	net_data_layout layout;
+} net_blob_data;
+
+typedef struct RoiAlignParam_S {
+	int input_width;
+	int input_height;
+	int input_channel;
+	int crop_in_c_st;
+	int crop_in_c_wd;
+	float roi_in_start_w;
+	float roi_in_end_w;
+	float roi_in_start_h;
+	float roi_in_end_h;
+	int output_width;
+	int output_height;
+	int output_channel;
+	int crop_out_x_st;
+	int crop_out_y_st;
+	int crop_out_c_st;
+	int bit_width;
+	int pooled_w;
+	int pooled_h;
+	int aligned;
+	float spatial_ratio;
+	float sampling_ratio;
+} roi_align_param;
+
+/*
+ * network
+ */
+VX_API_ENTRY vx_graph VX_API_CALL CreateNetGraph(
+	vx_context context,
+	vx_uint32 * net_topo,
+	vx_int8 * net_blobs,
+	bool on_chip_mem_enable = false,
+	bool io_mem_shared = false,
+	int hold_block_idx = 0x7FFFFFFF,
+	int up_to_block_count = -1);
+
+VX_API_ENTRY vx_status VX_API_CALL GetNetInputBlob(
+	vx_graph graph, 
+	std::vector<std::string> & names, 
+	std::vector<vx_tensor> & blobs);
+
+VX_API_ENTRY vx_status VX_API_CALL GetNetOutputBlob(
+	vx_graph graph,
+	std::vector<std::string> & names,
+	std::vector<vx_tensor> & blobs);
+
+VX_API_ENTRY vx_status VX_API_CALL GetNetIntermediateBlob(
+	vx_graph graph,
+	std::vector<std::string>& names,
+	std::vector<vx_tensor>& blobs);
+
+VX_API_ENTRY vx_status VX_API_CALL GetNetBlobOriginDims(
+	vx_graph graph,
+	std::string& blob_name,
+	std::vector<int>& dims);
+
+/*
+ * batch network
+ */
+VX_API_ENTRY vx_graph VX_API_CALL CreateBatchNetGraph(
+	vx_context context,
+	vx_uint32* net_topo,
+	vx_int8* net_blobs,
+	int batch,
+	bool io_mem_shared = false);
+
+VX_API_ENTRY vx_status VX_API_CALL GetBatchNetInputBlob(
+	vx_graph graph,
+	std::vector<std::string>& names,
+	std::vector<std::vector<vx_tensor>>& blobs);
+
+VX_API_ENTRY vx_status VX_API_CALL GetBatchNetOutputBlob(
+	vx_graph graph,
+	std::vector<std::string>& names,
+	std::vector<std::vector<vx_tensor>>& blobs);
+
+/*
+ * config input buffer
+ */
+VX_API_ENTRY vx_status VX_API_CALL SetNetInputBuffer(
+	vx_graph graph,
+	std::string& blob_name,
+	vx_size handle,
+	int batch_idx = 0);
+
+VX_API_ENTRY vx_status VX_API_CALL ResetNetDefaultInputBuffer(
+	vx_graph graph,
+	std::string& blob_name,
+	int batch_idx = 0);
+
+/*
+ * import and export network data
+ */
+VX_API_ENTRY vx_status VX_API_CALL ImportNetInputDataFromImage(
+	vx_graph graph,
+	std::string& blob_name,
+	input_image* image,
+	int batch_idx = 0);
+
+VX_API_ENTRY vx_status VX_API_CALL ImportNetInputDataFromMem(
+	vx_graph graph, 
+	std::string & blob_name, 
+	int mem_data_len, 
+	vx_uint8* mem_data, 
+	int batch_idx = 0);
+
+VX_API_ENTRY vx_status VX_API_CALL ImportNetInputDataFromDataFile(
+	vx_graph graph,
+	std::string& blob_name,
+	char* fname,
+	int batch_idx = 0);
+
+VX_API_ENTRY vx_status VX_API_CALL EnableNetInputDataExtPreprocess(
+	vx_graph graph,
+	std::string& blob_name);
+
+VX_API_ENTRY vx_status VX_API_CALL DisableNetInputDataExtPreprocess(
+	vx_graph graph,
+	std::string& blob_name);
+
+VX_API_ENTRY vx_status VX_API_CALL ImportNetInputDataFromRawData(
+	vx_graph graph,
+	std::string& blob_name,
+	net_blob_data& blob_data,
+	int batch_idx = 0);
+
+VX_API_ENTRY vx_status VX_API_CALL ExportNetOutputRawData(
+	vx_graph graph,
+	std::string& blob_name,
+	net_blob_data& blob_data,
+	int batch_idx = 0);
+
+/*
+ * image process
+ */
+VX_API_ENTRY vx_size VX_API_CALL AllocDeviceImageBuffer(
+	vx_context context, 
+	img_fmt fmt, 
+	int width, 
+	int height);
+
+VX_API_ENTRY vx_size VX_API_CALL AllocDeviceMbgMaskImageBuffer(
+	vx_context context, 
+	int width, 
+	int height, 
+	int blk_width, 
+	int blk_height);
+
+VX_API_ENTRY vx_status VX_API_CALL FreeDeviceImageBuffer(
+	vx_context context, 
+	vx_size handle);
+
+VX_API_ENTRY vx_status VX_API_CALL ImageConvert(
+	vx_context context, 
+	img_cvt_param * param, 
+	vx_size input_phys_addr,
+	vx_size input_phys_addr_uv,
+	vx_size output_handle);
+
+VX_API_ENTRY vx_status VX_API_CALL BackgroundModeling(
+	vx_context context, 
+	mbg_param * param, 
+	vx_size input_phys_addr,
+	vx_size input_phys_addr_bg,
+	vx_size output_handle_bg,
+	vx_size output_handle_mask);
+
+VX_API_ENTRY vx_status VX_API_CALL ImageWarp(
+	vx_context context, 
+	img_warp_param * param, 
+	vx_size input_phys_addr, 
+	vx_size input_phys_addr_uv,
+	vx_size output_handle);
+
+VX_API_ENTRY vx_status VX_API_CALL RgbImageConvert(
+	int w, 
+	int h, 
+	img_data_layout layout, 
+	vx_uint8 * src, 
+	vx_uint8 * dst);
+	
+VX_API_ENTRY vx_status VX_API_CALL RgbImageRevert(
+	int w, 
+	int h, 
+	vx_uint8 * src, 
+	img_data_layout layout, 
+	vx_uint8 * dst);
+
+VX_API_ENTRY vx_status VX_API_CALL RoiAlign(
+	vx_context context,
+	roi_align_param& op_param,
+	vx_size input_handle,
+	vx_size output_handle);
+
+/*
+ * utility
+ */
+VX_API_ENTRY vx_status VX_API_CALL LoadNetModel(
+	vx_context context,
+	const char * model_file, 
+	bool encrypted,
+	vx_int8 ** model);
+
+VX_API_ENTRY vx_status VX_API_CALL LoadNetModelFromMem(
+	vx_context context,
+	vx_int8 * model_data,
+	int model_len,
+	bool encrypted,
+	vx_int8 ** model);
+	
+VX_API_ENTRY vx_status VX_API_CALL UnLoadNetModel(vx_int8 * model);
+
+#endif

+ 461 - 0
include/tiny_json.c

@@ -0,0 +1,461 @@
+
+/*
+
+<https://github.com/rafagafe/tiny-json>
+
+  Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+  SPDX-License-Identifier: MIT
+  Copyright (c) 2016-2018 Rafa Garcia <rafagarcia77@gmail.com>.
+
+  Permission is hereby  granted, free of charge, to any  person obtaining a copy
+  of this software and associated  documentation files (the "Software"), to deal
+  in the Software  without restriction, including without  limitation the rights
+  to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+  copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in all
+  copies or substantial portions of the Software.
+
+  THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+  IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+  FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+  AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+  LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+
+*/
+
+#include <string.h>
+#include <ctype.h>
+#include "tiny_json.h"
+
+/** Structure to handle a heap of JSON properties. */
+typedef struct jsonStaticPool_s {
+    json_t* mem;      /**< Pointer to array of json properties.      */
+    unsigned int qty; /**< Length of the array of json properties.   */
+    unsigned int nextFree;  /**< The index of the next free json property. */
+    jsonPool_t pool;
+} jsonStaticPool_t;
+
+/* Search a property by its name in a JSON object. */
+json_t const* json_getProperty( json_t const* obj, char const* property ) {
+    json_t const* sibling;
+    for( sibling = obj->u.c.child; sibling; sibling = sibling->sibling )
+        if ( sibling->name && !strcmp( sibling->name, property ) )
+            return sibling;
+    return 0;
+}
+
+/* Search a property by its name in a JSON object and return its value. */
+char const* json_getPropertyValue( json_t const* obj, char const* property ) {
+	json_t const* field = json_getProperty( obj, property );
+	if ( !field ) return 0;
+        jsonType_t type = json_getType( field );
+        if ( JSON_ARRAY >= type ) return 0;
+	return json_getValue( field );
+}
+
+/* Internal prototypes: */
+static char* goBlank( char* str );
+static char* goNum( char* str );
+static json_t* poolInit( jsonPool_t* pool );
+static json_t* poolAlloc( jsonPool_t* pool );
+static char* objValue( char* ptr, json_t* obj, jsonPool_t* pool );
+static char* setToNull( char* ch );
+static bool isEndOfPrimitive( char ch );
+
+/* Parse a string to get a json. */
+json_t const* json_createWithPool( char *str, jsonPool_t *pool ) {
+    char* ptr = goBlank( str );
+    if ( !ptr || (*ptr != '{' && *ptr != '[') ) return 0;
+    json_t* obj = pool->init( pool );
+    obj->name    = 0;
+    obj->sibling = 0;
+    obj->u.c.child = 0;
+    ptr = objValue( ptr, obj, pool );
+    if ( !ptr ) return 0;
+    return obj;
+}
+
+/* Parse a string to get a json. */
+json_t const* json_create( char* str, json_t mem[], unsigned int qty ) {
+    jsonStaticPool_t spool;
+    spool.mem = mem;
+    spool.qty = qty;
+    spool.pool.init = poolInit;
+    spool.pool.alloc = poolAlloc;
+    return json_createWithPool( str, &spool.pool );
+}
+
+/** Get a special character with its escape character. Examples:
+  * 'b' -> '\\b', 'n' -> '\\n', 't' -> '\\t'
+  * @param ch The escape character.
+  * @retval  The character code. */
+static char getEscape( char ch ) {
+    static struct { char ch; char code; } const pair[] = {
+        { '\"', '\"' }, { '\\', '\\' },
+        { '/',  '/'  }, { 'b',  '\b' },
+        { 'f',  '\f' }, { 'n',  '\n' },
+        { 'r',  '\r' }, { 't',  '\t' },
+    };
+    unsigned int i;
+    for( i = 0; i < sizeof pair / sizeof *pair; ++i )
+        if ( pair[i].ch == ch )
+            return pair[i].code;
+    return '\0';
+}
+
+/** Parse 4 characters.
+  * @param str Pointer to  first digit.
+  * @retval '?' If the four characters are hexadecimal digits.
+  * @retval '\0' In other cases. */
+static unsigned char getCharFromUnicode( unsigned char const* str ) {
+    unsigned int i;
+    for( i = 0; i < 4; ++i )
+        if ( !isxdigit( str[i] ) )
+            return '\0';
+    return '?';
+}
+
+/** Parse a string and replace the scape characters by their meaning characters.
+  * This parser stops when finds the character '\"'. Then replaces '\"' by '\0'.
+  * @param str Pointer to first character.
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* parseString( char* str ) {
+    unsigned char* head = (unsigned char*)str;
+    unsigned char* tail = (unsigned char*)str;
+    for( ; *head; ++head, ++tail ) {
+        if ( *head == '\"' ) {
+            *tail = '\0';
+            return (char*)++head;
+        }
+        if ( *head == '\\' ) {
+            if ( *++head == 'u' ) {
+                char const ch = getCharFromUnicode( ++head );
+                if ( ch == '\0' ) return 0;
+                *tail = ch;
+                head += 3;
+            }
+            else {
+                char const esc = getEscape( *head );
+                if ( esc == '\0' ) return 0;
+                *tail = esc;
+            }
+        }
+        else *tail = *head;
+    }
+    return 0;
+}
+
+/** Parse a string to get the name of a property.
+  * @param ptr Pointer to first character.
+  * @param property The property to assign the name.
+  * @retval Pointer to first of property value. If success.
+  * @retval Null pointer if any error occur. */
+static char* propertyName( char* ptr, json_t* property ) {
+    property->name = ++ptr;
+    ptr = parseString( ptr );
+    if ( !ptr ) return 0;
+    ptr = goBlank( ptr );
+    if ( !ptr ) return 0;
+    if ( *ptr++ != ':' ) return 0;
+    return goBlank( ptr );
+}
+
+/** Parse a string to get the value of a property when its type is JSON_TEXT.
+  * @param ptr Pointer to first character ('\"').
+  * @param property The property to assign the name.
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* textValue( char* ptr, json_t* property ) {
+    ++property->u.value;
+    ptr = parseString( ++ptr );
+    if ( !ptr ) return 0;
+    property->type = JSON_TEXT;
+    return ptr;
+}
+
+/** Compare two strings until get the null character in the second one.
+  * @param ptr sub string
+  * @param str main string
+  * @retval Pointer to next character.
+  * @retval Null pointer if any error occur. */
+static char* checkStr( char* ptr, char const* str ) {
+    while( *str )
+        if ( *ptr++ != *str++ )
+            return 0;
+    return ptr;
+}
+
+/** Parser a string to get a primitive value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type, (true, false or null).
+  * @param value String with the primitive literal.
+  * @param type The code of the type. ( JSON_BOOLEAN or JSON_NULL )
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* primitiveValue( char* ptr, json_t* property, char const* value, jsonType_t type ) {
+    ptr = checkStr( ptr, value );
+    if ( !ptr || !isEndOfPrimitive( *ptr ) ) return 0;
+    ptr = setToNull( ptr );
+    property->type = type;
+    return ptr;
+}
+
+/** Parser a string to get a true value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type, (true, false or null).
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* trueValue( char* ptr, json_t* property ) {
+    return primitiveValue( ptr, property, "true", JSON_BOOLEAN );
+}
+
+/** Parser a string to get a false value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type, (true, false or null).
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* falseValue( char* ptr, json_t* property ) {
+    return primitiveValue( ptr, property, "false", JSON_BOOLEAN );
+}
+
+/** Parser a string to get a null value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type, (true, false or null).
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* nullValue( char* ptr, json_t* property ) {
+    return primitiveValue( ptr, property, "null", JSON_NULL );
+}
+
+/** Analyze the exponential part of a real number.
+  * @param ptr Pointer to first character.
+  * @retval Pointer to first non numerical after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* expValue( char* ptr ) {
+    if ( *ptr == '-' || *ptr == '+' ) ++ptr;
+    if ( !isdigit( (int)(*ptr) ) ) return 0;
+    ptr = goNum( ++ptr );
+    return ptr;
+}
+
+/** Analyze the decimal part of a real number.
+  * @param ptr Pointer to first character.
+  * @retval Pointer to first non numerical after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* fraqValue( char* ptr ) {
+    if ( !isdigit( (int)(*ptr) ) ) return 0;
+    ptr = goNum( ++ptr );
+    if ( !ptr ) return 0;
+    return ptr;
+}
+
+/** Parser a string to get a numerical value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type: JSON_REAL or JSON_INTEGER.
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* numValue( char* ptr, json_t* property ) {
+    if ( *ptr == '-' ) ++ptr;
+    if ( !isdigit( (int)(*ptr) ) ) return 0;
+    if ( *ptr != '0' ) {
+        ptr = goNum( ptr );
+        if ( !ptr ) return 0;
+    }
+    else if ( isdigit( (int)(*++ptr) ) ) return 0;
+    property->type = JSON_INTEGER;
+    if ( *ptr == '.' ) {
+        ptr = fraqValue( ++ptr );
+        if ( !ptr ) return 0;
+        property->type = JSON_REAL;
+    }
+    if ( *ptr == 'e' || *ptr == 'E' ) {
+        ptr = expValue( ++ptr );
+        if ( !ptr ) return 0;
+        property->type = JSON_REAL;
+    }
+    if ( !isEndOfPrimitive( *ptr ) ) return 0;
+    if ( JSON_INTEGER == property->type ) {
+        char const* value = property->u.value;
+        bool const negative = *value == '-';
+        static char const min[] = "-9223372036854775808";
+        static char const max[] = "9223372036854775807";
+        unsigned int const maxdigits = ( negative? sizeof min: sizeof max ) - 1;
+        unsigned int const len = ( unsigned int const ) ( ptr - value );
+        if ( len > maxdigits ) return 0;
+        if ( len == maxdigits ) {
+            char const tmp = *ptr;
+            *ptr = '\0';
+            char const* const threshold = negative ? min: max;
+            if ( 0 > strcmp( threshold, value ) ) return 0;
+            *ptr = tmp;
+        }
+    }
+    ptr = setToNull( ptr );
+    return ptr;
+}
+
+/** Add a property to a JSON object or array.
+  * @param obj The handler of the JSON object or array.
+  * @param property The handler of the property to be added. */
+static void add( json_t* obj, json_t* property ) {
+    property->sibling = 0;
+    if ( !obj->u.c.child ){
+	    obj->u.c.child = property;
+	    obj->u.c.last_child = property;
+    } else {
+	    obj->u.c.last_child->sibling = property;
+	    obj->u.c.last_child = property;
+    }
+}
+
+/** Parser a string to get a json object value.
+  * @param ptr Pointer to first character.
+  * @param obj The handler of the JSON root object or array.
+  * @param pool The handler of a json pool for creating json instances.
+  * @retval Pointer to first character after the value. If success.
+  * @retval Null pointer if any error occur. */
+static char* objValue( char* ptr, json_t* obj, jsonPool_t* pool ) {
+    obj->type    = *ptr == '{' ? JSON_OBJ : JSON_ARRAY;
+    obj->u.c.child = 0;
+    obj->sibling = 0;
+    ptr++;
+    for(;;) {
+        ptr = goBlank( ptr );
+        if ( !ptr ) return 0;
+        if ( *ptr == ',' ) {
+            ++ptr;
+            continue;
+        }
+        char const endchar = ( obj->type == JSON_OBJ )? '}': ']';
+        if ( *ptr == endchar ) {
+            *ptr = '\0';
+            json_t* parentObj = obj->sibling;
+            if ( !parentObj ) return ++ptr;
+            obj->sibling = 0;
+            obj = parentObj;
+            ++ptr;
+            continue;
+        }
+        json_t* property = pool->alloc( pool );
+        if ( !property ) return 0;
+        if( obj->type != JSON_ARRAY ) {
+            if ( *ptr != '\"' ) return 0;
+            ptr = propertyName( ptr, property );
+            if ( !ptr ) return 0;
+        }
+        else property->name = 0;
+        add( obj, property );
+        property->u.value = ptr;
+        switch( *ptr ) {
+            case '{':
+                property->type    = JSON_OBJ;
+                property->u.c.child = 0;
+                property->sibling = obj;
+                obj = property;
+                ++ptr;
+                break;
+            case '[':
+                property->type    = JSON_ARRAY;
+                property->u.c.child = 0;
+                property->sibling = obj;
+                obj = property;
+                ++ptr;
+                break;
+            case '\"': ptr = textValue( ptr, property );  break;
+            case 't':  ptr = trueValue( ptr, property );  break;
+            case 'f':  ptr = falseValue( ptr, property ); break;
+            case 'n':  ptr = nullValue( ptr, property );  break;
+            default:   ptr = numValue( ptr, property );   break;
+        }
+        if ( !ptr ) return 0;
+    }
+}
+
+/** Initialize a json pool.
+  * @param pool The handler of the pool.
+  * @return a instance of a json. */
+static json_t* poolInit( jsonPool_t* pool ) {
+    jsonStaticPool_t *spool = json_containerOf( pool, jsonStaticPool_t, pool );
+    spool->nextFree = 1;
+    return spool->mem;
+}
+
+/** Create an instance of a json from a pool.
+  * @param pool The handler of the pool.
+  * @retval The handler of the new instance if success.
+  * @retval Null pointer if the pool was empty. */
+static json_t* poolAlloc( jsonPool_t* pool ) {
+    jsonStaticPool_t *spool = json_containerOf( pool, jsonStaticPool_t, pool );
+    if ( spool->nextFree >= spool->qty ) return 0;
+    return spool->mem + spool->nextFree++;
+}
+
+/** Checks whether an character belongs to set.
+  * @param ch Character value to be checked.
+  * @param set Set of characters. It is just a null-terminated string.
+  * @return true or false there is membership or not. */
+static bool isOneOfThem( char ch, char const* set ) {
+    while( *set != '\0' )
+        if ( ch == *set++ )
+            return true;
+    return false;
+}
+
+/** Increases a pointer while it points to a character that belongs to a set.
+  * @param str The initial pointer value.
+  * @param set Set of characters. It is just a null-terminated string.
+  * @return The final pointer value or null pointer if the null character was found. */
+static char* goWhile( char* str, char const* set ) {
+    for(; *str != '\0'; ++str ) {
+        if ( !isOneOfThem( *str, set ) )
+            return str;
+    }
+    return 0;
+}
+
+/** Set of characters that defines a blank. */
+static char const* const blank = " \n\r\t\f";
+
+/** Increases a pointer while it points to a white space character.
+  * @param str The initial pointer value.
+  * @return The final pointer value or null pointer if the null character was found. */
+static char* goBlank( char* str ) {
+    return goWhile( str, blank );
+}
+
+/** Increases a pointer while it points to a decimal digit character.
+  * @param str The initial pointer value.
+  * @return The final pointer value or null pointer if the null character was found. */
+static char* goNum( char* str ) {
+    for( ; *str != '\0'; ++str ) {
+        if ( !isdigit( (int)(*str) ) )
+            return str;
+    }
+    return 0;
+}
+
+/** Set of characters that defines the end of an array or a JSON object. */
+static char const* const endofblock = "}]";
+
+/** Set a char to '\0' and increase its pointer if the char is different to '}' or ']'.
+  * @param ch Pointer to character.
+  * @return  Final value pointer. */
+static char* setToNull( char* ch ) {
+    if ( !isOneOfThem( *ch, endofblock ) ) *ch++ = '\0';
+    return ch;
+}
+
+/** Indicate if a character is the end of a primitive value. */
+static bool isEndOfPrimitive( char ch ) {
+    return ch == ',' || isOneOfThem( ch, blank ) || isOneOfThem( ch, endofblock );
+}

+ 176 - 0
include/tiny_json.h

@@ -0,0 +1,176 @@
+
+/*
+
+<https://github.com/rafagafe/tiny-json>
+     
+  Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+  SPDX-License-Identifier: MIT
+  Copyright (c) 2016-2018 Rafa Garcia <rafagarcia77@gmail.com>.
+
+  Permission is hereby  granted, free of charge, to any  person obtaining a copy
+  of this software and associated  documentation files (the "Software"), to deal
+  in the Software  without restriction, including without  limitation the rights
+  to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+  copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in all
+  copies or substantial portions of the Software.
+
+  THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+  IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+  FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+  AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+  LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+    
+*/
+
+#ifndef _TINY_JSON_H_
+#define	_TINY_JSON_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define json_containerOf( ptr, type, member ) \
+    ((type*)( (char*)ptr - offsetof( type, member ) ))
+
+/** @defgroup tinyJson Tiny JSON parser.
+  * @{ */
+
+/** Enumeration of codes of supported JSON properties types. */
+typedef enum {
+    JSON_OBJ, JSON_ARRAY, JSON_TEXT, JSON_BOOLEAN,
+    JSON_INTEGER, JSON_REAL, JSON_NULL
+} jsonType_t;
+
+/** Structure to handle JSON properties. */
+typedef struct json_s {
+    struct json_s* sibling;
+    char const* name;
+    union {
+        char const* value;
+        struct {
+            struct json_s* child;
+            struct json_s* last_child;
+        } c;
+    } u;
+    jsonType_t type;
+} json_t;
+
+/** Parse a string to get a json.
+  * @param str String pointer with a JSON object. It will be modified.
+  * @param mem Array of json properties to allocate.
+  * @param qty Number of elements of mem.
+  * @retval Null pointer if any was wrong in the parse process.
+  * @retval If the parser process was successfully a valid handler of a json.
+  *         This property is always unnamed and its type is JSON_OBJ. */
+json_t const* json_create( char* str, json_t mem[], unsigned int qty );
+
+/** Get the name of a json property.
+  * @param json A valid handler of a json property.
+  * @retval Pointer to null-terminated if property has name.
+  * @retval Null pointer if the property is unnamed. */
+static inline char const* json_getName( json_t const* json ) {
+    return json->name;
+}
+
+/** Get the value of a json property.
+  * The type of property cannot be JSON_OBJ or JSON_ARRAY.
+  * @param property A valid handler of a json property.
+  * @return Pointer to null-terminated string with the value. */
+static inline char const* json_getValue( json_t const* property ) {
+    return property->u.value;
+}
+
+/** Get the type of a json property.
+  * @param json A valid handler of a json property.
+  * @return The code of type.*/
+static inline jsonType_t json_getType( json_t const* json ) {
+    return json->type;
+}
+
+/** Get the next sibling of a JSON property that is within a JSON object or array.
+  * @param json A valid handler of a json property.
+  * @retval The handler of the next sibling if found.
+  * @retval Null pointer if the json property is the last one. */
+static inline json_t const* json_getSibling( json_t const* json ) {
+    return json->sibling;
+}
+
+/** Search a property by its name in a JSON object.
+  * @param obj A valid handler of a json object. Its type must be JSON_OBJ.
+  * @param property The name of property to get.
+  * @retval The handler of the json property if found.
+  * @retval Null pointer if not found. */
+json_t const* json_getProperty( json_t const* obj, char const* property );
+
+
+/** Search a property by its name in a JSON object and return its value.
+  * @param obj A valid handler of a json object. Its type must be JSON_OBJ.
+  * @param property The name of property to get.
+  * @retval If found a pointer to null-terminated string with the value.
+  * @retval Null pointer if not found or it is an array or an object. */
+char const* json_getPropertyValue( json_t const* obj, char const* property );
+
+/** Get the first property of a JSON object or array.
+  * @param json A valid handler of a json property.
+  *             Its type must be JSON_OBJ or JSON_ARRAY.
+  * @retval The handler of the first property if there is.
+  * @retval Null pointer if the json object has not properties. */
+static inline json_t const* json_getChild( json_t const* json ) {
+    return json->u.c.child;
+}
+
+/** Get the value of a json boolean property.
+  * @param property A valid handler of a json object. Its type must be JSON_BOOLEAN.
+  * @return The value stdbool. */
+static inline bool json_getBoolean( json_t const* property ) {
+    return *property->u.value == 't';
+}
+
+/** Get the value of a json integer property.
+  * @param property A valid handler of a json object. Its type must be JSON_INTEGER.
+  * @return The value stdint. */
+static inline int64_t json_getInteger( json_t const* property ) {
+  return strtoll( property->u.value,(char**)NULL, 10);
+}
+
+/** Get the value of a json real property.
+  * @param property A valid handler of a json object. Its type must be JSON_REAL.
+  * @return The value. */
+static inline double json_getReal( json_t const* property ) {
+  return strtod( property->u.value,(char**)NULL );
+}
+
+
+
+/** Structure to handle a heap of JSON properties. */
+typedef struct jsonPool_s jsonPool_t;
+struct jsonPool_s {
+    json_t* (*init)( jsonPool_t* pool );
+    json_t* (*alloc)( jsonPool_t* pool );
+};
+
+/** Parse a string to get a json.
+  * @param str String pointer with a JSON object. It will be modified.
+  * @param pool Custom json pool pointer.
+  * @retval Null pointer if any was wrong in the parse process.
+  * @retval If the parser process was successfully a valid handler of a json.
+  *         This property is always unnamed and its type is JSON_OBJ. */
+json_t const* json_createWithPool( char* str, jsonPool_t* pool );
+
+/** @ } */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TINY_JSON_H_ */

+ 62 - 0
include/yolo.h

@@ -0,0 +1,62 @@
+#ifndef _YOLOV_H_
+#define _YOLOV_H_
+#include "eznn_api.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+const char *yolov_labels_name[1] = {
+	"face"
+};
+
+typedef enum ezax_yolo_model {
+	EZAX_MODEL_YOLOV3,
+	EZAX_MODEL_YOLOV5,
+} ezax_yolo_model_t;
+
+typedef struct eazx_custom_det_cfg {
+	char *model_rootpath;
+	int   model_type;
+	int   width;
+	int   height;
+} ezax_custom_det_cfg_t;
+
+typedef struct ax_nna_tensor
+{
+    /* vir and phy addr */
+    void *pVir; unsigned pPhy;
+    /* data size */
+    int  nDatasz;
+    /* tensor width, height, channel, batch number, fraction point */
+    int  w; int h; int c; int n; int fl;
+    /* 2: int8, 4 int16 */
+    int dtype;
+    /* tensor name */
+    char nTensorName[32];
+    /* reserved */
+    int  rzv;
+}ax_nna_tensor_t;
+
+typedef struct ax_nna_tensors
+{
+    /* tensor pointer */
+    ax_nna_tensor_t *nTensor;
+    /* tensor number */
+    int  nTensorNum;
+}ax_nna_tensors_t;
+
+typedef enum ezax_custom_det_cmd {
+	EZAX_CUSTOM_DET_RESET_AXFREQ,
+	EZAX_CUSTOM_DET_GET_AXFREQ,
+} ezax_custom_det_cmd_t;
+
+void *nna_custom_det_open(ezax_custom_det_cfg_t *cfg);
+int  nna_custom_det_cmd(void *hdl, ezax_custom_det_cmd_t cmd,unsigned int args);
+int nna_custom_det_process(void *hdl,ezax_img_t *pImg,ezax_boxes_t *yolo_det_out,float conf_thresh,float iou_thresh);
+int  nna_custom_det_close(void *hdl);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif

+ 83 - 0
include_bakbak/VX/vx.h

@@ -0,0 +1,83 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_H_
+#define _OPENVX_H_
+
+/*!
+ * \file
+ * \brief The top level OpenVX Header.
+ */
+
+/*! \brief Defines the length of the implementation name string, including the trailing zero.
+ * \ingroup group_context
+ */
+#define VX_MAX_IMPLEMENTATION_NAME (64)
+
+/*! \brief Defines the length of a kernel name string to be added to OpenVX, including the trailing zero.
+ * \ingroup group_kernel
+ */
+#define VX_MAX_KERNEL_NAME (256)
+
+/*! \brief Defines the length of a message buffer to copy from the log, including the trailing zero.
+ * \ingroup group_basic_features
+ */
+#define VX_MAX_LOG_MESSAGE_LEN (1024)
+
+/*! \brief Defines the length of the reference name string, including the trailing zero.
+ * \ingroup group_reference
+ * \see vxSetReferenceName
+ */
+#define VX_MAX_REFERENCE_NAME (64)
+
+#include <VX/vx_vendors.h>
+#include <VX/vx_types.h>
+#include <VX/vx_kernels.h>
+#include <VX/vx_api.h>
+#include <VX/vx_nodes.h>
+
+/*! \brief Defines the major version number macro.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_MAJOR(x) ((x & 0xFF) << 8)
+
+/*! \brief Defines the minor version number macro.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_MINOR(x) ((x & 0xFF) << 0)
+
+/*! \brief Defines the predefined version number for 1.0.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_1_0      (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(0))
+
+/*! \brief Defines the predefined version number for 1.1.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_1_1      (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(1))
+
+/*! \brief Defines the predefined version number for 1.2.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION_1_2      (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(2))
+
+/*! \brief Defines the OpenVX Version Number.
+ * \ingroup group_basic_features
+ */
+#define VX_VERSION          VX_VERSION_1_2
+
+#endif

+ 3166 - 0
include_bakbak/VX/vx_api.h

@@ -0,0 +1,3166 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_API_H_
+#define _OPENVX_API_H_
+
+/*!
+ * \file
+ * \brief The API definition for OpenVX.
+ */
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/*==============================================================================
+ CONTEXT
+ =============================================================================*/
+
+/*! \brief Creates a <tt>\ref vx_context</tt>.
+ * \details This creates a top-level object context for OpenVX.
+ * \note This is required to do anything else.
+ * \returns The reference to the implementation context <tt>\ref vx_context</tt>. Any possible errors
+ * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_context
+ * \post <tt>\ref vxReleaseContext</tt>
+ */
+VX_API_ENTRY vx_context VX_API_CALL vxCreateContext(void);
+
+/*! \brief Releases the OpenVX object context.
+ * \details All reference counted objects are garbage-collected by the return of this call.
+ * No calls are possible using the parameter context after the context has been
+ * released until a new reference from <tt>\ref vxCreateContext</tt> is returned.
+ * All outstanding references to OpenVX objects from this context are invalid
+ * after this call.
+ * \param [in] context The pointer to the reference to the context.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \ingroup group_context
+ * \pre <tt>\ref vxCreateContext</tt>
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseContext(vx_context *context);
+
+/*! \brief Retrieves the context from any reference from within a context.
+ * \param [in] reference The reference from which to extract the context.
+ * \ingroup group_context
+ * \return The overall context that created the particular
+ * reference. Any possible errors preventing a successful completion of this function
+ * should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_context VX_API_CALL vxGetContext(vx_reference reference);
+
+/*! \brief Queries the context for some specific information.
+ * \param [in] context The reference to the context.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_context_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not supported on this implementation.
+ * \ingroup group_context
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryContext(vx_context context, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Sets an attribute on the context.
+ * \param [in] context The handle to the overall context.
+ * \param [in] attribute The attribute to set from <tt>\ref vx_context_attribute_e</tt>.
+ * \param [in] ptr The pointer to the data to which to set the attribute.
+ * \param [in] size The size in bytes of the data to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not settable.
+ * \ingroup group_context
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetContextAttribute(vx_context context, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Provides a generic API to give platform-specific hints to the implementation.
+ * \param [in] reference The reference to the object to hint at.
+ * This could be <tt>\ref vx_context</tt>, <tt>\ref vx_graph</tt>, <tt>\ref vx_node</tt>, <tt>\ref vx_image</tt>, <tt>\ref vx_array</tt>, or any other reference.
+ * \param [in] hint A <tt>\ref vx_hint_e</tt> \a hint to give to a \ref vx_context. This is a platform-specific optimization or implementation mechanism.
+ * \param [in] data Optional vendor specific data.
+ * \param [in] data_size Size of the data structure \p data.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE reference is not a valid <tt>\ref vx_reference</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED If the hint is not supported.
+ * \ingroup group_hint
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxHint(vx_reference reference, vx_enum hint, const void* data, vx_size data_size);
+
+/*! \brief Provides a generic API to give platform-specific directives to the implementations.
+ * \param [in] reference The reference to the object to set the directive on.
+ * This could be <tt>\ref vx_context</tt>, <tt>\ref vx_graph</tt>, <tt>\ref vx_node</tt>, <tt>\ref vx_image</tt>, <tt>\ref vx_array</tt>, or any other reference.
+ * \param [in] directive The directive to set. See <tt>\ref vx_directive_e</tt>.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE reference is not a valid <tt>\ref vx_reference</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED If the directive is not supported.
+ * \note The performance counter directives are only available for the reference \ref vx_context.
+ *       Error VX_ERROR_NOT_SUPPORTED is returned when used with any other reference.
+ * \ingroup group_directive
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxDirective(vx_reference reference, vx_enum directive);
+
+/*! \brief Provides a generic API to return status values from Object constructors if they
+ * fail.
+ * \note Users do not need to strictly check every object creator as the errors
+ * should properly propagate and be detected during verification time or run-time.
+ * \code
+ * vx_image img = vxCreateImage(context, 639, 480, VX_DF_IMAGE_UYVY);
+ * vx_status status = vxGetStatus((vx_reference)img);
+ * // status == VX_ERROR_INVALID_DIMENSIONS
+ * vxReleaseImage(&img);
+ * \endcode
+ * \pre Appropriate Object Creator function.
+ * \post Appropriate Object Release function.
+ * \param [in] reference The reference to check for construction errors.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval * Some error occurred, please check enumeration list and constructor.
+ * \ingroup group_basic_features
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxGetStatus(vx_reference reference);
+
+/*!
+ * \brief Registers user-defined structures to the context.
+ * \param [in] context  The reference to the implementation context.
+ * \param [in] size     The size of user struct in bytes.
+ * \return A <tt>\ref vx_enum</tt> value that is a type given to the User
+ * to refer to their custom structure when declaring a <tt>\ref vx_array</tt>
+ * of that structure.
+ * \retval VX_TYPE_INVALID If the namespace of types has been exhausted.
+ * \note This call should only be used once within the lifetime of a context for
+ * a specific structure.
+ * \ingroup group_adv_array
+ */
+VX_API_ENTRY vx_enum VX_API_CALL vxRegisterUserStruct(vx_context context, vx_size size);
+
+/*!
+ * \brief Allocates and registers user-defined kernel enumeration to a context.
+ * The allocated enumeration is from available pool of 4096 enumerations reserved
+ * for dynamic allocation from VX_KERNEL_BASE(VX_ID_USER,0).
+ * \param [in] context  The reference to the implementation context.
+ * \param [out] pKernelEnumId  pointer to return <tt>\ref vx_enum</tt> for user-defined kernel.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE If the context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_NO_RESOURCES The enumerations has been exhausted.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAllocateUserKernelId(vx_context context, vx_enum * pKernelEnumId);
+
+/*!
+ * \brief Allocates and registers user-defined kernel library ID to a context.
+ *
+ * The allocated library ID is from available pool of library IDs (1..255)
+ * reserved for dynamic allocation. The returned libraryId can be used by
+ * user-kernel library developer to specify individual kernel enum IDs in
+ * a header file, shown below:
+ * \code
+ * #define MY_KERNEL_ID1(libraryId) (VX_KERNEL_BASE(VX_ID_USER,libraryId) + 0);
+ * #define MY_KERNEL_ID2(libraryId) (VX_KERNEL_BASE(VX_ID_USER,libraryId) + 1);
+ * #define MY_KERNEL_ID3(libraryId) (VX_KERNEL_BASE(VX_ID_USER,libraryId) + 2);
+ * \endcode
+ * \param [in] context  The reference to the implementation context.
+ * \param [out] pLibraryId  pointer to <tt>\ref vx_enum</tt> for user-kernel libraryId.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_NO_RESOURCES The enumerations has been exhausted.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAllocateUserKernelLibraryId(vx_context context, vx_enum * pLibraryId);
+
+/*! \brief Sets the default target of the immediate mode. Upon successful execution of this
+ * function any future execution of immediate mode function is attempted on the new default
+ * target of the context.
+ * \param [in] context  The reference to the implementation context.
+ * \param [in] target_enum  The default immediate mode target enum to be set
+ * to the <tt>\ref vx_context</tt> object. Use a <tt>\ref vx_target_e</tt>.
+ * \param [in] target_string  The target name ASCII string. This contains a valid value
+ * when target_enum is set to <tt>\ref VX_TARGET_STRING</tt>, otherwise it is ignored.
+ * \ingroup group_context
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Default target set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE If the context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED If the specified target is not supported in this context.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetImmediateModeTarget(vx_context context, vx_enum target_enum, const char* target_string);
+
+/*==============================================================================
+ IMAGE
+ =============================================================================*/
+
+/*! \brief Creates an opaque reference to an image buffer.
+ * \details Not guaranteed to exist until the <tt>\ref vx_graph</tt> containing it has been verified.
+ * \param [in] context The reference to the implementation context.
+ * \param [in] width The image width in pixels. The image in the formats of
+ * <tt>\ref VX_DF_IMAGE_NV12</tt>, <tt>\ref VX_DF_IMAGE_NV21</tt>, <tt>\ref VX_DF_IMAGE_IYUV</tt>,
+ * <tt>\ref VX_DF_IMAGE_UYVY</tt>, <tt>\ref VX_DF_IMAGE_YUYV</tt> must have even width.
+ * \param [in] height The image height in pixels. The image in the formats of
+ * <tt>\ref VX_DF_IMAGE_NV12</tt>, <tt>\ref VX_DF_IMAGE_NV21</tt>, <tt>\ref VX_DF_IMAGE_IYUV</tt>
+ * must have even height.
+ * \param [in] color The VX_DF_IMAGE (<tt>\ref vx_df_image_e</tt>) code that represents the format
+ * of the image and the color space.
+ * \returns An image reference <tt>\ref vx_image</tt>. Any possible errors preventing a successful
+ * creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \see vxMapImagePatch to obtain direct memory access to the image data.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_image VX_API_CALL vxCreateImage(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image color);
+
+/*! \brief Creates an image from another image given a rectangle. This second
+ * reference refers to the data in the original image. Updates to this image
+ * updates the parent image. The rectangle must be defined within the pixel space
+ * of the parent image.
+ * \param [in] img The reference to the parent image.
+ * \param [in] rect The region of interest rectangle. Must contain points within
+ * the parent image pixel space.
+ * \returns An image reference <tt>\ref vx_image</tt> to the sub-image. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_image VX_API_CALL vxCreateImageFromROI(vx_image img, const vx_rectangle_t *rect);
+
+/*! \brief Creates a reference to an image object that has a singular,
+ * uniform value in all pixels. The uniform image created is read-only.
+ * \param [in] context The reference to the implementation context.
+ * \param [in] width The image width in pixels. The image in the formats of
+ * <tt>\ref VX_DF_IMAGE_NV12</tt>, <tt>\ref VX_DF_IMAGE_NV21</tt>, <tt>\ref VX_DF_IMAGE_IYUV</tt>,
+ * <tt>\ref VX_DF_IMAGE_UYVY</tt>, <tt>\ref VX_DF_IMAGE_YUYV</tt> must have even width.
+ * \param [in] height The image height in pixels. The image in the formats of
+ * <tt>\ref VX_DF_IMAGE_NV12</tt>, <tt>\ref VX_DF_IMAGE_NV21</tt>,
+ * <tt>\ref VX_DF_IMAGE_IYUV</tt> must have even height.
+ * \param [in] color The VX_DF_IMAGE (\ref vx_df_image_e) code that represents the format of the image and the color space.
+ * \param [in] value The pointer to the pixel value to which to set all pixels. See <tt>\ref vx_pixel_value_t</tt>.
+ * \returns An image reference <tt>\ref vx_image</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * <tt>\see vxMapImagePatch</tt> to obtain direct memory access to the image data.
+ * \note <tt>\ref vxMapImagePatch</tt> and <tt>\ref vxUnmapImagePatch</tt> may be called with
+ * a uniform image reference.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_image VX_API_CALL vxCreateUniformImage(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image color, const vx_pixel_value_t *value);
+
+/*! \brief Creates an opaque reference to an image buffer with no direct
+ * user access. This function allows setting the image width, height, or format.
+ * \details Virtual data objects allow users to connect various nodes within a
+ * graph via data references without access to that data, but they also permit the
+ * implementation to take maximum advantage of possible optimizations. Use this
+ * API to create a data reference to link two or more nodes together when the
+ * intermediate data are not required to be accessed by outside entities. This API
+ * in particular allows the user to define the image format of the data without
+ * requiring the exact dimensions. Virtual objects are scoped within the graph
+ * they are declared a part of, and can't be shared outside of this scope.
+ * All of the following constructions of virtual images are valid.
+ * \code
+ * vx_context context = vxCreateContext();
+ * vx_graph graph = vxCreateGraph(context);
+ * vx_image virt[] = {
+ *     vxCreateVirtualImage(graph, 0, 0, VX_DF_IMAGE_U8), // no specified dimension
+ *     vxCreateVirtualImage(graph, 320, 240, VX_DF_IMAGE_VIRT), // no specified format
+ *     vxCreateVirtualImage(graph, 640, 480, VX_DF_IMAGE_U8), // no user access
+ * };
+ * \endcode
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] width The width of the image in pixels. A value of zero informs the interface
+ * that the value is unspecified. The image in the formats of <tt>\ref VX_DF_IMAGE_NV12</tt>,
+ * <tt>\ref VX_DF_IMAGE_NV21</tt>, <tt>\ref VX_DF_IMAGE_IYUV</tt>, <tt>\ref VX_DF_IMAGE_UYVY</tt>,
+ * <tt>\ref VX_DF_IMAGE_YUYV</tt> must have even width.
+ * \param [in] height The height of the image in pixels. A value of zero informs the interface
+ * that the value is unspecified. The image in the formats of <tt>\ref VX_DF_IMAGE_NV12</tt>,
+ * <tt>\ref VX_DF_IMAGE_NV21</tt>, <tt>\ref VX_DF_IMAGE_IYUV</tt> must have even height.
+ * \param [in] color The VX_DF_IMAGE (<tt>\ref vx_df_image_e</tt>) code that represents the format
+ * of the image and the color space. A value of <tt>\ref VX_DF_IMAGE_VIRT</tt> informs the
+ * interface that the format is unspecified.
+ * \returns An image reference <tt>\ref vx_image</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \note Passing this reference to <tt>\ref vxMapImagePatch</tt> will return an error.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_image VX_API_CALL vxCreateVirtualImage(vx_graph graph, vx_uint32 width, vx_uint32 height, vx_df_image color);
+
+/*! \brief Creates a reference to an image object that was externally allocated.
+ * \param [in] context The reference to the implementation context.
+ * \param [in] color See the <tt>\ref vx_df_image_e</tt> codes. This mandates the
+ * number of planes needed to be valid in the \a addrs and \a ptrs arrays based on the format given.
+ * \param [in] addrs[] The array of image patch addressing structures that
+ * define the dimension and stride of the array of pointers. See note below.
+ * \param [in] ptrs[] The array of platform-defined references to each plane. See note below.
+ * \param [in] memory_type <tt>\ref vx_memory_type_e</tt>. When giving <tt>\ref VX_MEMORY_TYPE_HOST</tt>
+ * the \a ptrs array is assumed to be HOST accessible pointers to memory.
+ * \returns An image reference <tt>\ref vx_image</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \note The user must call vxMapImagePatch prior to accessing the pixels of an image, even if the
+ * image was created via <tt>\ref vxCreateImageFromHandle</tt>. Reads or writes to memory referenced
+ * by ptrs[ ] after calling <tt>\ref vxCreateImageFromHandle</tt> without first calling
+ * <tt>\ref vxMapImagePatch</tt> will result in undefined behavior.
+ * The property of addr[] and ptrs[] arrays is kept by the caller (It means that the implementation will
+ * make an internal copy of the provided information. \a addr and \a ptrs can then simply be application's
+ * local variables).
+ * Only \a dim_x, \a dim_y, \a stride_x and \a stride_y fields of the <tt>\ref vx_imagepatch_addressing_t</tt> need to be
+ * provided by the application. Other fields (\a step_x, \a step_y, \a scale_x & \a scale_y) are ignored by this function.
+ * The layout of the imported memory must follow a row-major order. In other words, \a stride_x should be
+ * sufficiently large so that there is no overlap between data elements corresponding to different
+ * pixels, and \a stride_y >= \a stride_x * \a dim_x.
+ *
+ * In order to release the image back to the application we should use <tt>\ref vxSwapImageHandle</tt>.
+ *
+ * Import type of the created image is available via the image attribute <tt>\ref vx_image_attribute_e</tt> parameter.
+ *
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_image VX_API_CALL vxCreateImageFromHandle(vx_context context, vx_df_image color, const vx_imagepatch_addressing_t addrs[], void *const ptrs[], vx_enum memory_type);
+
+/*! \brief Swaps the image handle of an image previously created from handle.
+ *
+ * This function sets the new image handle (i.e. pointer to all image planes)
+ * and returns the previous one.
+ *
+ * Once this function call has completed, the application gets back the
+ * ownership of the memory referenced by the previous handle. This memory
+ * contains up-to-date pixel data, and the application can safely reuse or
+ * release it.
+ *
+ * The memory referenced by the new handle must have been allocated
+ * consistently with the image properties since the import type,
+ * memory layout and dimensions are unchanged (see addrs, color, and
+ * memory_type in <tt>\ref vxCreateImageFromHandle</tt>).
+ *
+ * All images created from ROI or channel with this image as parent or ancestor
+ * will automatically use the memory referenced by the new handle.
+ *
+ * The behavior of <tt>\ref vxSwapImageHandle</tt> when called from a user node is undefined.
+ * \param [in] image The reference to an image created from handle
+ * \param [in] new_ptrs[] pointer to a caller owned array that contains
+ * the new image handle (image plane pointers)
+ * \arg new_ptrs is non NULL. new_ptrs[i] must be non NULL for each i such as
+ * 0 < i < nbPlanes, otherwise, this is an error. The address of the storage memory
+ * for image plane i is set to new_ptrs[i]
+ * \arg new_ptrs is NULL: the previous image storage memory is reclaimed by the
+ * caller, while no new handle is provided.
+ * \param [out] prev_ptrs[] pointer to a caller owned array in which
+ * the application returns the previous image handle
+ * \arg prev_ptrs is non NULL. prev_ptrs must have at least as many
+ * elements as the number of image planes. For each i such as
+ * 0 < i < nbPlanes , prev_ptrs[i] is set to the address of the previous storage
+ * memory for plane i.
+ * \arg prev_ptrs NULL: the previous handle is not returned.
+ * \param [in] num_planes Number of planes in the image. This must be set equal to the number of planes of the input image.
+ *  The number of elements in new_ptrs and prev_ptrs arrays must be equal to or greater than num_planes.
+ * If either array has more than num_planes elements, the extra elements are ignored. If either array is smaller
+ * than num_planes, the results are undefined.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS The image was not created from handle or
+ * the content of new_ptrs is not valid.
+ * \retval VX_FAILURE The image was already being accessed.
+ * \ingroup group_image
+ */
+
+VX_API_ENTRY vx_status VX_API_CALL vxSwapImageHandle(vx_image image, void* const new_ptrs[], void* prev_ptrs[], vx_size num_planes);
+
+/*! \brief Retrieves various attributes of an image.
+ * \param [in] image The reference to the image to query.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_image_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not supported on this implementation.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryImage(vx_image image, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows setting attributes on the image.
+ * \param [in] image The reference to the image on which to set the attribute.
+ * \param [in] attribute The attribute to set. Use a <tt>\ref vx_image_attribute_e</tt> enumeration.
+ * \param [in] ptr The pointer to the location from which to read the value.
+ * \param [in] size The size in bytes of the object pointed to by \a ptr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetImageAttribute(vx_image image, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Initialize an image with the given pixel value.
+ * \param [in] image The reference to the image to initialize.
+ * \param [in] pixel_value The pointer to the constant pixel value to initialize all image pixels. See <tt>\ref vx_pixel_value_t</tt>.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_ERROR_INVALID_REFERENCE If the image is a uniform image, a virtual image, or not a <tt>\ref vx_image</tt>.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \note All pixels of the entire image are initialized to the indicated pixel value, independently from the valid region.
+ * The valid region of the image is unaffected by this function. The image remains mutable after the call to this function,
+ * so its pixels and mutable attributes may be changed by subsequent functions.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetImagePixelValues(vx_image image, const vx_pixel_value_t *pixel_value);
+
+/*! \brief Releases a reference to an image object.
+ * The object may not be garbage collected until its total reference count is zero.
+ *
+ * An implementation may defer the actual object destruction after its total
+ * reference count is zero (potentially until context destruction). Thus,
+ * releasing an image created from handle
+ * (see <tt>\ref vxCreateImageFromHandle</tt>) and all others objects that may
+ * reference it (nodes, ROI, or channel for instance) are not sufficient to get back the
+ * ownership of the memory referenced by the current image handle. The only way
+ * for this is to call <tt>\ref vxSwapImageHandle</tt>) before releasing the
+ * image.
+ *
+ * \param [in] image The pointer to the image to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseImage(vx_image *image);
+
+/*!
+ * \brief Accesses a specific indexed pixel in an image patch.
+ * \param [in] ptr The base pointer of the patch as returned from <tt>\ref vxMapImagePatch</tt>.
+ * \param [in] index The 0 based index of the pixel count in the patch. Indexes increase horizontally by 1 then wrap around to the next row.
+ * \param [in] addr The pointer to the addressing mode information returned from <tt>\ref vxMapImagePatch</tt>.
+ * \return void * Returns the pointer to the specified pixel.
+ * \pre <tt>\ref vxMapImagePatch</tt>
+ * \ingroup group_image
+ */
+VX_API_ENTRY void * VX_API_CALL vxFormatImagePatchAddress1d(void *ptr, vx_uint32 index, const vx_imagepatch_addressing_t *addr);
+
+/*!
+ * \brief Accesses a specific pixel at a 2d coordinate in an image patch.
+ * \param [in] ptr The base pointer of the patch as returned from <tt>\ref vxMapImagePatch</tt>.
+ * \param [in] x The x dimension within the patch.
+ * \param [in] y The y dimension within the patch.
+ * \param [in] addr The pointer to the addressing mode information returned from <tt>\ref vxMapImagePatch</tt>.
+ * \return void * Returns the pointer to the specified pixel.
+ * \pre <tt>\ref vxMapImagePatch</tt>
+ * \ingroup group_image
+ */
+VX_API_ENTRY void * VX_API_CALL vxFormatImagePatchAddress2d(void *ptr, vx_uint32 x, vx_uint32 y, const vx_imagepatch_addressing_t *addr);
+
+/*! \brief Retrieves the valid region of the image as a rectangle.
+ * \param [in] image The image from which to retrieve the valid region.
+ * \param [out] rect The destination rectangle.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS Invalid rect.
+ * \note This rectangle can be passed directly to <tt>\ref vxMapImagePatch</tt> to get
+ * the full valid region of the image.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxGetValidRegionImage(vx_image image, vx_rectangle_t *rect);
+
+/*! \brief Allows the application to copy a rectangular patch from/into an image object plane.
+ * \param [in] image The reference to the image object that is the source or the
+ * destination of the copy.
+ * \param [in] image_rect The coordinates of the image patch. The patch must be within
+ * the bounds of the image. (start_x, start_y) gives the coordinates of the topleft
+ * pixel inside the patch, while (end_x, end_y) gives the coordinates of the bottomright
+ * element out of the patch. Must be 0 <= start < end <= number of pixels in the image dimension.
+ * \param [in] image_plane_index The plane index of the image object that is the source or the
+ * destination of the patch copy.
+ * \param [in] user_addr The address of a structure describing the layout of the
+ * user memory location pointed by user_ptr. In the structure, only dim_x, dim_y,
+ * stride_x and stride_y fields must be provided, other fields are ignored by the function.
+ * The layout of the user memory must follow a row major order:
+ * stride_x >= pixel size in bytes, and stride_y >= stride_x * dim_x.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the image
+ * object if the copy was requested in write mode. The accessible memory must be large enough
+ * to contain the specified patch with the specified layout:
+ * accessible memory in bytes >= (end_y - start_y) * stride_y.
+ * \param [in] usage This declares the effect of the copy with regard to the image object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. For uniform images, only VX_READ_ONLY
+ * is supported. For other images, Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt> are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data is copied from the image object into the application memory
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data is copied into the image object from the application memory
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_OPTIMIZED_AWAY This is a reference to a virtual image that cannot be
+ * accessed by the application.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \note The application may ask for data outside the bounds of the valid region, but
+ * such data has an undefined value.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyImagePatch(vx_image image, const vx_rectangle_t *image_rect, vx_uint32 image_plane_index, const vx_imagepatch_addressing_t *user_addr, void * user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+
+/*! \brief Allows the application to get direct access to a rectangular patch of an image object plane.
+ * \param [in] image The reference to the image object that contains the patch to map.
+ * \param [in] rect The coordinates of image patch. The patch must be within the
+ * bounds of the image. (start_x, start_y) gives the coordinate of the topleft
+ * element inside the patch, while (end_x, end_y) give the coordinate of
+ * the bottomright element out of the patch. Must be 0 <= start < end.
+ * \param [in] plane_index The plane index of the image object to be accessed.
+ * \param [out] map_id The address of a <tt>\ref vx_map_id</tt> variable where the function
+ * returns a map identifier.
+ * \arg (*map_id) must eventually be provided as the map_id parameter of a call to
+ * <tt>\ref vxUnmapImagePatch</tt>.
+ * \param [out] addr The address of a structure describing the memory layout of the
+ * image patch to access. The function fills the structure pointed by addr with the
+ * layout information that the application must consult to access the pixel data
+ * at address (*ptr). The layout of the mapped memory follows a row-major order:
+ * stride_x>0, stride_y>0 and stride_y >= stride_x * dim_x.
+ * If the image object being accessed was created via
+ * <tt>\ref vxCreateImageFromHandle</tt>, then the returned memory layout will be
+ * the identical to that of the addressing structure provided when
+ * <tt>\ref vxCreateImageFromHandle</tt> was called.
+ * \param [out] ptr The address of a pointer that the function sets to the
+ * address where the requested data can be accessed. This returned (*ptr) address
+ * is only valid between the call to this function and the corresponding call to
+ * <tt>\ref vxUnmapImagePatch</tt>.
+ * If image was created via <tt>\ref vxCreateImageFromHandle</tt> then the returned
+ * address (*ptr) will be the address of the patch in the original pixel buffer
+ * provided when image was created.
+ * \param [in] usage This declares the access mode for the image patch, using
+ * the <tt>\ref vx_accessor_e</tt> enumeration. For uniform images, only VX_READ_ONLY
+ * is supported.
+ * \arg <tt>\ref VX_READ_ONLY</tt>: after the function call, the content of the memory location
+ * pointed by (*ptr) contains the image patch data. Writing into this memory location
+ * is forbidden and its behavior is undefined.
+ * \arg <tt>\ref VX_READ_AND_WRITE</tt>: after the function call, the content of the memory
+ * location pointed by (*ptr) contains the image patch data; writing into this memory
+ * is allowed only for the location of pixels only and will result in a modification
+ * of the written pixels in the image object once the patch is unmapped. Writing into
+ * a gap between pixels (when addr->stride_x > pixel size in bytes or addr->stride_y > addr->stride_x*addr->dim_x)
+ * is forbidden and its behavior is undefined.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt>: after the function call, the memory location pointed by (*ptr)
+ * contains undefined data; writing each pixel of the patch is required prior to
+ * unmapping. Pixels not written by the application before unmap will become
+ * undefined after unmap, even if they were well defined before map. Like for
+ * VX_READ_AND_WRITE, writing into a gap between pixels is forbidden and its behavior
+ * is undefined.
+ * \param [in] mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory where the image patch is requested to be mapped.
+ * \param [in] flags An integer that allows passing options to the map operation.
+ * Use the <tt>\ref vx_map_flag_e</tt> enumeration.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_OPTIMIZED_AWAY This is a reference to a virtual image that cannot be
+ * accessed by the application.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \note The user may ask for data outside the bounds of the valid region, but
+ * such data has an undefined value.
+ * \ingroup group_image
+ * \post <tt>\ref vxUnmapImagePatch </tt> with same (*map_id) value.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxMapImagePatch(vx_image image, const vx_rectangle_t *rect, vx_uint32 plane_index, vx_map_id *map_id, vx_imagepatch_addressing_t *addr, void **ptr, vx_enum usage, vx_enum mem_type, vx_uint32 flags);
+
+
+/*! \brief Unmap and commit potential changes to a image object patch that were previously mapped.
+ * Unmapping an image patch invalidates the memory location from which the patch could
+ * be accessed by the application. Accessing this memory location after the unmap function
+ * completes has an undefined behavior.
+ * \param [in] image The reference to the image object to unmap.
+ * \param [out] map_id The unique map identifier that was returned by <tt>\ref vxMapImagePatch</tt> .
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_image
+ * \pre <tt>\ref vxMapImagePatch</tt> with same map_id value
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxUnmapImagePatch(vx_image image, vx_map_id map_id);
+
+/*! \brief Create a sub-image from a single plane channel of another image.
+ *
+ * The sub-image refers to the data in the original image. Updates to this image
+ * update the parent image and reversely.
+ *
+ * The function supports only channels that occupy an entire plane of a multi-planar
+ * images, as listed below. Other cases are not supported.
+ *     VX_CHANNEL_Y from YUV4, IYUV, NV12, NV21
+ *     VX_CHANNEL_U from YUV4, IYUV
+ *     VX_CHANNEL_V from YUV4, IYUV
+ *
+ * \param [in] img          The reference to the parent image.
+ * \param [in] channel      The <tt>\ref vx_channel_e</tt> channel to use.
+
+ * \returns An image reference <tt>\ref vx_image</tt> to the sub-image. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_image VX_API_CALL vxCreateImageFromChannel(vx_image img, vx_enum channel);
+
+
+/*! \brief Sets the valid rectangle for an image according to a supplied rectangle.
+ * \note Setting or changing the valid region from within a user node by means other than the call-back, for
+ * example by calling <tt>\ref vxSetImageValidRectangle</tt>, might result in an incorrect valid region calculation
+ * by the framework.
+ * \param [in] image  The reference to the image.
+ * \param [in] rect   The value to be set to the image valid rectangle. A NULL indicates that the valid region is the entire image.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE image is not a valid <tt>\ref vx_image</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS The rect does not define a proper valid rectangle.
+ * \ingroup group_image
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetImageValidRectangle(vx_image image, const vx_rectangle_t *rect);
+
+
+
+/*==============================================================================
+ KERNEL
+ =============================================================================*/
+
+/*! \brief Loads a library of kernels, called module, into a context.
+ *
+ * The module must be a dynamic library with by convention, two exported functions
+ * named <tt>vxPublishKernels</tt> and <tt>vxUnpublishKernels</tt>.
+ *
+ * <tt>vxPublishKernels</tt> must have type <tt>\ref vx_publish_kernels_f</tt>,
+ * and must add kernels to the context by calling <tt>\ref vxAddUserKernel</tt>
+ * for each new kernel. <tt>vxPublishKernels</tt> is called by <tt>\ref vxLoadKernels</tt>.
+ *
+ * <tt>vxUnpublishKernels</tt> must have type <tt>\ref vx_unpublish_kernels_f</tt>,
+ * and must remove kernels from the context by calling <tt>\ref vxRemoveKernel</tt>
+ * for each kernel the <tt>vxPublishKernels</tt> has added.
+ * <tt>vxUnpublishKernels</tt> is called by <tt>\ref vxUnloadKernels</tt>.
+ *
+ * \note When all references to loaded kernels are released, the module
+ * may be automatically unloaded.
+ * \param [in] context The reference to the context the kernels must be added to.
+ * \param [in] module The short name of the module to load. On systems where
+ * there are specific naming conventions for modules, the name passed
+ * should ignore such conventions. For example: \c libxyz.so should be
+ * passed as just \c xyz and the implementation will <i>do the right thing</i> that
+ * the platform requires.
+ * \note This API uses the system pre-defined paths for modules.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \ingroup group_user_kernels
+ * \see vxGetKernelByName
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxLoadKernels(vx_context context, const vx_char *module);
+
+/*! \brief Unloads all kernels from the OpenVX context that had been loaded from
+ * the module using the \ref vxLoadKernels function.
+ *
+ * The kernel unloading is performed by calling the <tt>vxUnpublishKernels</tt>
+ * exported function of the module.
+ * \note <tt>vxUnpublishKernels</tt> is defined in the description of
+ * <tt>\ref vxLoadKernels</tt>.
+ *
+ * \param [in] context The reference to the context the kernels must be removed from.
+ * \param [in] module The short name of the module to unload. On systems where
+ * there are specific naming conventions for modules, the name passed
+ * should ignore such conventions. For example: \c libxyz.so should be
+ * passed as just \c xyz and the implementation will <i>do the right thing</i>
+ * that the platform requires.
+ * \note This API uses the system pre-defined paths for modules.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE context is not a valid <tt>\ref vx_context</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are
+ incorrect.
+ * \ingroup group_user_kernels
+ * \see vxLoadKernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxUnloadKernels(vx_context context, const vx_char *module);
+
+/*! \brief Obtains a reference to a kernel using a string to specify the name.
+ * \details User Kernels follow a "dotted" heirarchical syntax. For example:
+ * "com.company.example.xyz". The following are strings specifying the kernel names:
+
+ * org.khronos.openvx.color_convert
+
+ * org.khronos.openvx.channel_extract
+
+ * org.khronos.openvx.channel_combine
+
+ * org.khronos.openvx.sobel_3x3
+
+ * org.khronos.openvx.magnitude
+
+ * org.khronos.openvx.phase
+
+ * org.khronos.openvx.scale_image
+
+ * org.khronos.openvx.table_lookup
+
+ * org.khronos.openvx.histogram
+
+ * org.khronos.openvx.equalize_histogram
+
+ * org.khronos.openvx.absdiff
+
+ * org.khronos.openvx.mean_stddev
+
+ * org.khronos.openvx.threshold
+
+ * org.khronos.openvx.integral_image
+
+ * org.khronos.openvx.dilate_3x3
+
+ * org.khronos.openvx.erode_3x3
+
+ * org.khronos.openvx.median_3x3
+
+ * org.khronos.openvx.box_3x3
+
+ * org.khronos.openvx.gaussian_3x3
+
+ * org.khronos.openvx.custom_convolution
+
+ * org.khronos.openvx.gaussian_pyramid
+
+ * org.khronos.openvx.accumulate
+
+ * org.khronos.openvx.accumulate_weighted
+
+ * org.khronos.openvx.accumulate_square
+
+ * org.khronos.openvx.minmaxloc
+
+ * org.khronos.openvx.convertdepth
+
+ * org.khronos.openvx.canny_edge_detector
+
+ * org.khronos.openvx.and
+
+ * org.khronos.openvx.or
+
+ * org.khronos.openvx.xor
+
+ * org.khronos.openvx.not
+
+ * org.khronos.openvx.multiply
+
+ * org.khronos.openvx.add
+
+ * org.khronos.openvx.subtract
+
+ * org.khronos.openvx.warp_affine
+
+ * org.khronos.openvx.warp_perspective
+
+ * org.khronos.openvx.harris_corners
+
+ * org.khronos.openvx.fast_corners
+
+ * org.khronos.openvx.optical_flow_pyr_lk
+
+ * org.khronos.openvx.remap
+
+ * org.khronos.openvx.halfscale_gaussian
+
+ * org.khronos.openvx.laplacian_pyramid
+
+ * org.khronos.openvx.laplacian_reconstruct
+
+ * org.khronos.openvx.non_linear_filter
+
+ * org.khronos.openvx.match_template
+
+ * org.khronos.openvx.lbp
+
+ * org.khronos.openvx.hough_lines_p
+
+ * org.khronos.openvx.tensor_multiply
+ 
+ * org.khronos.openvx.tensor_add
+ 
+ * org.khronos.openvx.tensor_subtract
+ 
+ * org.khronos.openvx.tensor_table_lookup
+ 
+ * org.khronos.openvx.tensor_transpose
+ 
+ * org.khronos.openvx.tensor_convert_depth
+ 
+ * org.khronos.openvx.tensor_matrix_multiply
+ 
+ * org.khronos.openvx.copy
+ 
+ * org.khronos.openvx.non_max_suppression
+ 
+ * org.khronos.openvx.scalar_operation
+ 
+ * org.khronos.openvx.hog_features
+ 
+ * org.khronos.openvx.hog_cells
+ 
+ * org.khronos.openvx.bilateral_filter
+
+ * org.khronos.openvx.select
+
+ * org.khronos.openvx.min
+
+ * org.khronos.openvx.max
+
+ * \param [in] context The reference to the implementation context.
+ * \param [in] name The string of the name of the kernel to get.
+ * \return A kernel reference. Any possible errors preventing a successful
+ * completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_kernel
+ * \pre <tt>\ref vxLoadKernels</tt> if the kernel is not provided by the
+ * OpenVX implementation.
+ * \note User Kernels should follow a "dotted" hierarchical syntax. For example:
+ * "com.company.example.xyz".
+ */
+VX_API_ENTRY vx_kernel VX_API_CALL vxGetKernelByName(vx_context context, const vx_char *name);
+
+/*! \brief Obtains a reference to the kernel using the <tt>\ref vx_kernel_e</tt> enumeration.
+ * \details Enum values above the standard set are assumed to apply to
+ * loaded libraries.
+ * \param [in] context The reference to the implementation context.
+ * \param [in] kernel A value from <tt>\ref vx_kernel_e</tt> or a vendor or client-defined value.
+ * \return A <tt>\ref vx_kernel</tt> reference. Any possible errors preventing a successful completion
+ * of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_kernel
+ * \pre <tt>\ref vxLoadKernels</tt> if the kernel is not provided by the
+ * OpenVX implementation.
+ */
+VX_API_ENTRY vx_kernel VX_API_CALL vxGetKernelByEnum(vx_context context, vx_enum kernel);
+
+/*! \brief This allows the client to query the kernel to get information about
+ * the number of parameters, enum values, etc.
+ * \param [in] kernel The kernel reference to query.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_kernel_attribute_e</tt>.
+ * \param [out] ptr The pointer to the location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute value is not supported in this implementation.
+ * \ingroup group_kernel
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryKernel(vx_kernel kernel, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Release the reference to the kernel.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] kernel The pointer to the kernel reference to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \ingroup group_kernel
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseKernel(vx_kernel *kernel);
+
+/*! \brief Allows users to add custom kernels to a context at run-time.
+ * \param [in] context The reference to the context the kernel must be added to.
+ * \param [in] name The string to use to match the kernel.
+ * \param [in] enumeration The enumerated value of the kernel to be used by clients.
+ * \param [in] func_ptr The process-local function pointer to be invoked.
+ * \param [in] numParams The number of parameters for this kernel.
+ * \param [in] validate The pointer to <tt>\ref vx_kernel_validate_f</tt>, which validates
+ * parameters to this kernel.
+ * \param [in] init The kernel initialization function.
+ * \param [in] deinit The kernel de-initialization function.
+ * \return A <tt>\ref vx_kernel</tt> reference. Any possible errors
+ * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_kernel VX_API_CALL vxAddUserKernel(vx_context context,
+                             const vx_char name[VX_MAX_KERNEL_NAME],
+                             vx_enum enumeration,
+                             vx_kernel_f func_ptr,
+                             vx_uint32 numParams,
+                             vx_kernel_validate_f validate,
+                             vx_kernel_initialize_f init,
+                             vx_kernel_deinitialize_f deinit);
+
+/*! \brief This API is called after all parameters have been added to the
+ * kernel and the kernel is \e ready to be used. Notice that the reference to the kernel created
+ * by vxAddUserKernel is still valid after the call to vxFinalizeKernel.
+ * If an error occurs, the kernel is not available for usage by the clients of OpenVX. Typically
+ * this is due to a mismatch between the number of parameters requested and given.
+ * \param [in] kernel The reference to the loaded kernel from <tt>\ref vxAddUserKernel</tt>.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \pre <tt>\ref vxAddUserKernel</tt> and <tt>\ref vxAddParameterToKernel</tt>
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxFinalizeKernel(vx_kernel kernel);
+
+/*! \brief Allows users to set the signatures of the custom kernel.
+ * \param [in] kernel The reference to the kernel added with <tt>\ref vxAddUserKernel</tt>.
+ * \param [in] index The index of the parameter to add.
+ * \param [in] dir The direction of the parameter. This must be either <tt>\ref VX_INPUT</tt> or
+ * <tt>\ref VX_OUTPUT</tt>. <tt>\ref VX_BIDIRECTIONAL</tt> is not supported for this function.
+ * \param [in] data_type The type of parameter. This must be a value from <tt>\ref vx_type_e</tt>.
+ * \param [in] state The state of the parameter (required or not). This must be a value from <tt>\ref vx_parameter_state_e</tt>.
+ * \return A <tt>\ref vx_status_e</tt> enumerated value.
+ * \retval VX_SUCCESS Parameter is successfully set on kernel; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If the parameter is not valid for any reason.
+ * \pre <tt>\ref vxAddUserKernel</tt>
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAddParameterToKernel(vx_kernel kernel, vx_uint32 index, vx_enum dir, vx_enum data_type, vx_enum state);
+
+/*! \brief Removes a custom kernel from its context and releases it.
+ * \param [in] kernel The reference to the kernel to remove. Returned from <tt>\ref vxAddUserKernel</tt>.
+ * \note Any kernel enumerated in the base standard
+ * cannot be removed; only kernels added through <tt>\ref vxAddUserKernel</tt> can
+ * be removed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration. The function returns to the
+ * application full control over the memory resources provided at the kernel creation time.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS If a base kernel is passed in.
+ * \retval VX_FAILURE If the application has not released all references to the kernel
+ * object OR if the application has not released all references to a node that is using
+ * this kernel OR if the application has not released all references to a graph which
+ * has nodes that is using this kernel.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxRemoveKernel(vx_kernel kernel);
+
+/*! \brief Sets kernel attributes.
+ * \param [in] kernel The reference to the kernel.
+ * \param [in] attribute The enumeration of the attributes. See <tt>\ref vx_kernel_attribute_e</tt>.
+ * \param [in] ptr The pointer to the location from which to read the attribute.
+ * \param [in] size The size in bytes of the data area indicated by \a ptr in bytes.
+ * \note After a kernel has been passed to <tt>\ref vxFinalizeKernel</tt>, no attributes
+ * can be altered.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE kernel is not a valid <tt>\ref vx_kernel</tt> reference.
+ * \ingroup group_user_kernels
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetKernelAttribute(vx_kernel kernel, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Retrieves a <tt>\ref vx_parameter</tt> from a <tt>\ref vx_kernel</tt>.
+ * \param [in] kernel The reference to the kernel.
+ * \param [in] index The index of the parameter.
+ * \return A <tt>\ref vx_parameter</tt> reference. Any possible errors preventing a
+ * successful completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_parameter
+ */
+VX_API_ENTRY vx_parameter VX_API_CALL vxGetKernelParameterByIndex(vx_kernel kernel, vx_uint32 index);
+
+/*==============================================================================
+ GRAPH
+ =============================================================================*/
+
+/*! \brief Creates an empty graph.
+ * \param [in] context The reference to the implementation context.
+ * \returns A graph reference <tt>\ref vx_graph</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_graph VX_API_CALL vxCreateGraph(vx_context context);
+
+/*! \brief Releases a reference to a graph.
+ * The object may not be garbage collected until its total reference count is zero.
+ * Once the reference count is zero, all node references in the graph are automatically
+ * released as well. Releasing the graph will only release the nodes if the nodes were
+ * not previously released by the application. Data referenced by those nodes may not
+ * be released as the user may still have references to the data.
+ * \param [in] graph The pointer to the graph to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseGraph(vx_graph *graph);
+
+/*! \brief Verifies the state of the graph before it is executed.
+ * This is useful to catch programmer errors and contract errors. If not verified,
+ * the graph verifies before being processed.
+ * \pre Memory for data objects is not guarenteed to exist before
+ * this call. \post After this call data objects exist unless
+ * the implementation optimized them out.
+ * \param [in] graph The reference to the graph to verify.
+ * \return A status code for graphs with more than one error; it is
+ * undefined which error will be returned. Register a log callback using <tt>\ref vxRegisterLogCallback</tt>
+ * to receive each specific error in the graph.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \retval VX_ERROR_MULTIPLE_WRITERS If the graph contains more than one writer
+ * to any data object.
+ * \retval VX_ERROR_INVALID_NODE If a node in the graph is invalid or failed be created.
+ * \retval VX_ERROR_INVALID_GRAPH If the graph contains cycles or some other invalid topology.
+ * \retval VX_ERROR_INVALID_TYPE If any parameter on a node is given the wrong type.
+ * \retval VX_ERROR_INVALID_VALUE If any value of any parameter is out of bounds of specification.
+ * \retval VX_ERROR_INVALID_FORMAT If the image format is not compatible.
+ * \ingroup group_graph
+ * \see vxProcessGraph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxVerifyGraph(vx_graph graph);
+
+/*! \brief This function causes the synchronous processing of a graph. If the graph
+ * has not been verified, then the implementation verifies the graph
+ * immediately. If verification fails this function returns a status
+ * identical to what <tt>\ref vxVerifyGraph</tt> would return. After
+ * the graph verfies successfully then processing occurs. If the graph was
+ * previously verified via <tt>\ref vxVerifyGraph</tt> or <tt>\ref vxProcessGraph</tt>
+ * then the graph is processed. This function blocks until the graph is completed.
+ * \param [in] graph The graph to execute.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Graph has been processed; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \retval VX_FAILURE A catastrophic error occurred during processing.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxProcessGraph(vx_graph graph);
+#if DUMP_GRAPH
+VX_API_ENTRY vx_status VX_API_CALL vxDumpGraph(vx_graph graph, void * info_file);
+#endif
+
+/*! \brief Schedules a graph for future execution. If the graph
+ * has not been verified, then the implementation verifies the graph
+ * immediately. If verification fails this function returns a status
+ * identical to what <tt>\ref vxVerifyGraph</tt> would return. After
+ * the graph verfies successfully then processing occurs. If the graph was
+ * previously verified via <tt>\ref vxVerifyGraph</tt> or <tt>\ref vxProcessGraph</tt>
+ * then the graph is processed.
+ * \param [in] graph The graph to schedule.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS The graph has been scheduled; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \retval VX_ERROR_NO_RESOURCES The graph cannot be scheduled now.
+ * \retval VX_ERROR_NOT_SUFFICIENT The graph is not verified and has failed
+ * forced verification.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxScheduleGraph(vx_graph graph);
+
+/*! \brief Waits for a specific graph to complete. If the graph has been scheduled multiple
+ * times since the last call to vxWaitGraph, then vxWaitGraph returns only when the last
+ * scheduled execution completes.
+ * \param [in] graph The graph to wait on.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS The graph has successfully completed execution and its outputs are the
+ * valid results of the most recent execution; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \retval VX_FAILURE An error occurred or the graph was never scheduled. Output data of the
+ * graph is undefined.
+ * \pre <tt>\ref vxScheduleGraph</tt>
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxWaitGraph(vx_graph graph);
+
+/*! \brief Allows the user to query attributes of the Graph.
+ * \param [in] graph The reference to the created graph.
+ * \param [in] attribute The <tt>\ref vx_graph_attribute_e</tt> type needed.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryGraph(vx_graph graph, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows the attributes of the Graph to be set to the provided value.
+ * \param [in] graph The reference to the graph.
+ * \param [in] attribute The <tt>\ref vx_graph_attribute_e</tt> type needed.
+ * \param [in] ptr The location from which to read the value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphAttribute(vx_graph graph, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Adds the given parameter extracted from a <tt>\ref vx_node</tt> to the graph.
+ * \param [in] graph The graph reference that contains the node.
+ * \param [in] parameter The parameter reference to add to the graph from the node.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Parameter added to Graph; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference or parameter is not a valid <tt>\ref vx_parameter</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS The parameter is of a node not in this
+ * graph.
+ * \ingroup group_graph_parameters
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAddParameterToGraph(vx_graph graph, vx_parameter parameter);
+
+/*! \brief Sets a reference to the parameter on the graph. The implementation
+ * must set this parameter on the originating node as well.
+ * \param [in] graph The graph reference.
+ * \param [in] index The parameter index.
+ * \param [in] value The reference to set to the parameter.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Parameter set to Graph; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference or
+ * value is not a valid <tt>\ref vx_reference</tt>.
+ * \retval VX_ERROR_INVALID_PARAMETERS The parameter index is out of bounds or the
+ * dir parameter is incorrect.
+ * \ingroup group_graph_parameters
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphParameterByIndex(vx_graph graph, vx_uint32 index, vx_reference value);
+
+/*! \brief Retrieves a <tt>\ref vx_parameter</tt> from a <tt>\ref vx_graph</tt>.
+ * \param [in] graph The graph.
+ * \param [in] index The index of the parameter.
+ * \return <tt>\ref vx_parameter</tt> reference. Any possible errors preventing a successful
+ * function completion should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_graph_parameters
+ */
+VX_API_ENTRY vx_parameter VX_API_CALL vxGetGraphParameterByIndex(vx_graph graph, vx_uint32 index);
+
+/*! \brief Returns a Boolean to indicate the state of graph verification.
+ * \param [in] graph The reference to the graph to check.
+ * \return A <tt>\ref vx_bool</tt> value.
+ * \retval vx_true_e The graph is verified.
+ * \retval vx_false_e The graph is not verified. It must be verified before
+ * execution either through <tt>\ref vxVerifyGraph</tt> or automatically through
+ * <tt>\ref vxProcessGraph</tt> or <tt>\ref vxScheduleGraph</tt>.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_bool VX_API_CALL vxIsGraphVerified(vx_graph graph);
+
+/*==============================================================================
+ NODE
+ =============================================================================*/
+
+/*! \brief Creates a reference to a node object for a given kernel.
+ * \details This node has no references assigned as parameters after completion.
+ * The client is then required to set these parameters manually by <tt>\ref vxSetParameterByIndex</tt>.
+ * When clients supply their own node creation functions (for use with User Kernels), this is the API
+ * to use along with the parameter setting API.
+ * \param [in] graph The reference to the graph in which this node exists.
+ * \param [in] kernel The kernel reference to associate with this new node.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \note A call to this API sets all parameters to NULL.
+ * \ingroup group_adv_node
+ * \post Call <tt>\ref vxSetParameterByIndex</tt> for as many parameters as needed to be set.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxCreateGenericNode(vx_graph graph, vx_kernel kernel);
+
+/*! \brief Allows a user to query information out of a node.
+ * \param [in] node The reference to the node to query.
+ * \param [in] attribute Use <tt>\ref vx_node_attribute_e</tt> value to query for information.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytesin bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS The type or size is incorrect.
+ * \ingroup group_node
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryNode(vx_node node, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows a user to set attribute of a node before Graph Validation.
+ * \param [in] node The reference to the node to set.
+ * \param [in] attribute Use <tt>\ref vx_node_attribute_e</tt> value to set the desired attribute.
+ * \param [in] ptr The pointer to the desired value of the attribute.
+ * \param [in] size The size in bytes of the objects to which \a ptr points.
+ * \note Some attributes are inherited from the <tt>\ref vx_kernel</tt>, which was used
+ * to create the node. Some of these can be overridden using this API, notably
+ * \ref VX_NODE_LOCAL_DATA_SIZE and \ref VX_NODE_LOCAL_DATA_PTR.
+ * \ingroup group_node
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS The attribute was set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS size is not correct for the type needed.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetNodeAttribute(vx_node node, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Releases a reference to a Node object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] node The pointer to the reference of the node to release.
+ * \ingroup group_node
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseNode(vx_node *node);
+
+/*! \brief Removes a Node from its parent Graph and releases it.
+ * \param [in] node The pointer to the node to remove and release.
+ * \ingroup group_node
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxRemoveNode(vx_node *node);
+
+/*! \brief Assigns a callback to a node.
+ * If a callback already exists in this node, this function must return an error
+ * and the user may clear the callback by passing a NULL pointer as the callback.
+ * \param [in] node The reference to the node.
+ * \param [in] callback The callback to associate with completion of this
+ * specific node.
+ * \warning This must be used with <b><i>extreme</i></b> caution as it can \e ruin
+ * optimizations in the power/performance efficiency of a graph.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Callback assigned; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ * \ingroup group_node_callback
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAssignNodeCallback(vx_node node, vx_nodecomplete_f callback);
+
+/*! \brief Retrieves the current node callback function pointer set on the node.
+ * \param [in] node The reference to the <tt>\ref vx_node</tt> object.
+ * \ingroup group_node_callback
+ * \return vx_nodecomplete_f The pointer to the callback function.
+ * \retval NULL No callback is set.
+ * \retval * The node callback function.
+ */
+VX_API_ENTRY vx_nodecomplete_f VX_API_CALL vxRetrieveNodeCallback(vx_node node);
+
+/*! \brief Sets the node target to the provided value. A success invalidates the graph
+ * that the node belongs to (<tt>\ref vxVerifyGraph</tt> must be called before the next execution)
+ * \param [in] node  The reference to the <tt>\ref vx_node</tt> object.
+ * \param [in] target_enum  The target enum to be set to the <tt>\ref vx_node</tt> object.
+ * Use a <tt>\ref vx_target_e</tt>.
+ * \param [in] target_string  The target name ASCII string. This contains a valid value
+ * when target_enum is set to <tt>\ref VX_TARGET_STRING</tt>, otherwise it is ignored.
+ * \ingroup group_node
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Node target set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED If the node kernel is not supported by the specified target.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetNodeTarget(vx_node node, vx_enum target_enum, const char* target_string);
+
+/*! \brief Creates replicas of the same node first_node to process a set of objects
+ * stored in <tt>\ref vx_pyramid</tt> or <tt>\ref vx_object_array</tt>.
+ * first_node needs to have as parameter levels 0 of a <tt>\ref vx_pyramid</tt> or the index 0 of a <tt>\ref vx_object_array</tt>.
+ * Replica nodes are not accessible by the application through any means. An application request for removal of
+ * first_node from the graph will result in removal of all replicas. Any change of parameter or attribute of
+ * first_node will be propagated to the replicas. <tt>\ref vxVerifyGraph</tt> shall enforce consistency of parameters and attributes
+ * in the replicas.
+ * \param [in] graph The reference to the graph.
+ * \param [in] first_node The reference to the node in the graph that will be replicated.
+ * \param [in] replicate an array of size equal to the number of node parameters, vx_true_e for the parameters
+ * that should be iterated over (should be a reference to a vx_pyramid or a vx_object_array),
+ * vx_false_e for the parameters that should be the same across replicated nodes and for optional
+ * parameters that are not used. Should be vx_true_e for all output and bidirectional parameters.
+ * \param [in] number_of_parameters number of elements in the replicate array
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference, or first_node is not a
+ * valid <tt>\ref vx_node</tt> reference.
+ * \retval VX_ERROR_NOT_COMPATIBLE At least one of replicated parameters is not of level 0 of a pyramid or at index 0 of an object array.
+ * \retval VX_FAILURE If the node does not belong to the graph, or the number of objects in the parent objects of inputs and output are not the same.
+ * \ingroup group_node
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReplicateNode(vx_graph graph, vx_node first_node, vx_bool replicate[], vx_uint32 number_of_parameters);
+
+/*==============================================================================
+ PARAMETER
+ =============================================================================*/
+
+/*! \brief Retrieves a <tt>\ref vx_parameter</tt> from a <tt>\ref vx_node</tt>.
+ * \param [in] node The node from which to extract the parameter.
+ * \param [in] index The index of the parameter to which to get a reference.
+ * \return A parameter reference <tt>\ref vx_parameter</tt>. Any possible errors preventing a successful
+ * completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_parameter
+ */
+VX_API_ENTRY vx_parameter VX_API_CALL vxGetParameterByIndex(vx_node node, vx_uint32 index);
+
+/*! \brief Releases a reference to a parameter object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] param The pointer to the parameter to release.
+ * \ingroup group_parameter
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE param is not a valid <tt>\ref vx_parameter</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseParameter(vx_parameter *param);
+
+/*! \brief Sets the specified parameter data for a kernel on the node.
+ * \param [in] node The node that contains the kernel.
+ * \param [in] index The index of the parameter desired.
+ * \param [in] value The desired value of the parameter.
+ * \note A user may not provide a NULL value for a mandatory parameter of this API.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE node is not a valid <tt>\ref vx_node</tt> reference, or value
+ * is not a valid <tt>\ref vx_reference</tt> reference.
+ * \ingroup group_parameter
+ * \see vxSetParameterByReference
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetParameterByIndex(vx_node node, vx_uint32 index, vx_reference value);
+
+/*! \brief Associates a parameter reference and a data reference with a kernel
+ * on a node.
+ * \param [in] parameter The reference to the kernel parameter.
+ * \param [in] value The value to associate with the kernel parameter.
+ * \note A user may not provide a NULL value for a mandatory parameter of this API.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE parameter is not a valid <tt>\ref vx_parameter</tt> reference,
+ * or value is not a valid <tt>\ref vx_reference</tt> reference..
+ * \ingroup group_parameter
+ * \see vxGetParameterByIndex
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetParameterByReference(vx_parameter parameter, vx_reference value);
+
+/*! \brief Allows the client to query a parameter to determine its meta-information.
+ * \param [in] parameter The reference to the parameter.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_parameter_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE parameter is not a valid <tt>\ref vx_parameter</tt> reference.
+ * \ingroup group_parameter
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryParameter(vx_parameter parameter, vx_enum attribute, void *ptr, vx_size size);
+
+/*==============================================================================
+ SCALAR
+ =============================================================================*/
+
+/*! \brief Creates a reference to a scalar object. Also see \ref sub_node_parameters.
+ * \param [in] context The reference to the system context.
+ * \param [in] data_type The type of data to hold. Must be greater than
+ * <tt>\ref VX_TYPE_INVALID</tt> and less than or equal to <tt>\ref VX_TYPE_VENDOR_STRUCT_END</tt>.
+ * Or must be a <tt>\ref vx_enum</tt> returned from <tt>\ref vxRegisterUserStruct</tt>.
+ * \param [in] ptr The pointer to the initial value of the scalar.
+ * \ingroup group_scalar
+ * \returns A scalar reference <tt>\ref vx_scalar</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_scalar VX_API_CALL vxCreateScalar(vx_context context, vx_enum data_type, const void *ptr);
+
+/*! \brief Creates a reference to a scalar object. Also see \ref sub_node_parameters.
+ * \param [in] context The reference to the system context.
+ * \param [in] data_type The type of data to hold. Must be greater than
+ * <tt>\ref VX_TYPE_INVALID</tt> and less than or equal to <tt>\ref VX_TYPE_VENDOR_STRUCT_END</tt>.
+ * Or must be a <tt>\ref vx_enum</tt> returned from <tt>\ref vxRegisterUserStruct</tt>.
+ * \param [in] ptr The pointer to the initial value of the scalar.
+ * \param [in] size Size of data at ptr in bytes.
+ * \ingroup group_scalar
+ * \returns A scalar reference <tt>\ref vx_scalar</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_scalar VX_API_CALL vxCreateScalarWithSize(vx_context context, vx_enum data_type, const void *ptr, vx_size size);
+
+/*! \brief Creates an opaque reference to a scalar object with no direct user access.
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] data_type The type of data to hold. Must be greater than
+ * <tt>\ref VX_TYPE_INVALID</tt> and less than or equal to <tt>\ref VX_TYPE_VENDOR_STRUCT_END</tt>.
+ * Or must be a <tt>\ref vx_enum</tt> returned from <tt>\ref vxRegisterUserStruct</tt>.
+ * \see <tt>\ref vxCreateScalar</tt>
+ * \ingroup group_scalar
+ * \returns A scalar reference <tt>\ref vx_scalar</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_scalar VX_API_CALL vxCreateVirtualScalar(vx_graph graph, vx_enum data_type);
+
+/*! \brief Releases a reference to a scalar object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] scalar The pointer to the scalar to release.
+ * \ingroup group_scalar
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE scalar is not a valid <tt>\ref vx_scalar</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseScalar(vx_scalar *scalar);
+
+/*! \brief Queries attributes from a scalar.
+ * \param [in] scalar The scalar object.
+ * \param [in] attribute The enumeration to query. Use a <tt>\ref vx_scalar_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE scalar is not a valid <tt>\ref vx_scalar</tt> reference.
+ * \ingroup group_scalar
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryScalar(vx_scalar scalar, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows the application to copy from/into a scalar object.
+ * \param [in] scalar The reference to the scalar object that is the source or the
+ * destination of the copy.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the
+ * scalar object if the copy was requested in write mode. In the user memory, the scalar is
+ * a variable of the type corresponding to <tt>\ref VX_SCALAR_TYPE</tt>.
+ * The accessible memory must be large enough to contain this variable.
+ * \param [in] usage This declares the effect of the copy with regard to the scalar object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the scalar object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the scalar object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE scalar is not a valid <tt>\ref vx_scalar</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_scalar
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyScalar(vx_scalar scalar, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+/*! \brief Allows the application to copy from/into a scalar object with size.
+ * \param [in] scalar The reference to the scalar object that is the source or the
+ * destination of the copy.
+ * \param [in] size The size in bytes of the container to which \a user_ptr points.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the
+ * scalar object if the copy was requested in write mode. In the user memory, the scalar is
+ * a variable of the type corresponding to <tt>\ref VX_SCALAR_TYPE</tt>.
+ * The accessible memory must be large enough to contain this variable.
+ * \param [in] usage This declares the effect of the copy with regard to the scalar object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the scalar object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the scalar object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_ERROR_INVALID_REFERENCE The scalar reference is not actually a scalar reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_scalar
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyScalarWithSize(vx_scalar scalar, vx_size size, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+/*==============================================================================
+ REFERENCE
+ =============================================================================*/
+
+/*! \brief Queries any reference type for some basic information like count or type.
+ * \param [in] ref The reference to query.
+ * \param [in] attribute The value for which to query. Use <tt>\ref vx_reference_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE ref is not a valid <tt>\ref vx_reference</tt> reference.
+ * \ingroup group_reference
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryReference(vx_reference ref, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Releases a reference. The reference may potentially refer to multiple OpenVX objects of different types.
+ * This function can be used instead of calling a specific release function for each individual object type
+ * (e.g. vxRelease<object>). The object will not be destroyed until its total reference count is zero.
+ * \note After returning from this function the reference is zeroed.
+ * \param [in] ref_ptr The pointer to the reference of the object to release.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE ref_ptr is not a valid <tt>\ref vx_reference</tt> reference.
+ * \ingroup group_reference
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseReference(vx_reference* ref_ptr);
+
+/*!
+ * \brief Increments the reference counter of an object
+ * This function is used to express the fact that the OpenVX object is referenced
+ * multiple times by an application. Each time this function is called for
+ * an object, the application will need to release the object one additional
+ * time before it can be destructed
+ * \param [in] ref The reference to retain.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE ref is not a valid <tt>\ref vx_reference</tt> reference.
+ * \ingroup group_reference
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxRetainReference(vx_reference ref);
+VX_API_ENTRY vx_status VX_API_CALL vxRetainTensor(vx_tensor tensor);
+
+/*! \brief Name a reference
+ * \ingroup group_reference
+ *
+ * This function is used to associate a name to a referenced object. This name
+ * can be used by the OpenVX implementation in log messages and any
+ * other reporting mechanisms.
+ *
+ * The OpenVX implementation will not check if the name is unique in
+ * the reference scope (context or graph). Several references can then
+ * have the same name.
+ *
+ * \param [in] ref The reference to the object to be named.
+ * \param [in] name Pointer to the '\0' terminated string that identifies
+ *             the referenced object.
+ *             The string is copied by the function so that it
+ *             stays the property of the caller.
+ *             NULL means that the reference is not named.
+ *             The length of the string shall be lower than VX_MAX_REFERENCE_NAME bytes.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE ref is not a valid <tt>\ref vx_reference</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetReferenceName(vx_reference ref, const vx_char *name);
+
+/*==============================================================================
+ DELAY
+ =============================================================================*/
+
+/*! \brief Queries a <tt>\ref vx_delay</tt> object attribute.
+ * \param [in] delay The reference to a delay object.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_delay_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE delay is not a valid <tt>\ref vx_delay</tt> reference.
+ * \ingroup group_delay
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryDelay(vx_delay delay, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Releases a reference to a delay object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] delay The pointer to the delay object reference to release.
+ * \post After returning from this function the reference is zeroed.
+ * \ingroup group_delay
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE delay is not a valid <tt>\ref vx_delay</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseDelay(vx_delay *delay);
+
+
+/*! \brief Creates a Delay object.
+ * \details This function creates a delay object with \p num_slots slots. Each slot
+ * contains a clone of the exemplar. The clones only inherit the metadata of the
+ * exemplar. The data content of the exemplar is ignored and the clones have their
+ * data undefined at delay creation time.
+ * The function does not alter the exemplar. Also, it doesn't retain or release the
+ * reference to the exemplar.
+ * \note For the definition of metadata attributes see \ref vxSetMetaFormatAttribute.
+ * \param [in] context The reference to the context.
+ * \param [in] exemplar The exemplar object. Supported exemplar object types are:<br>
+ * \arg \ref VX_TYPE_ARRAY
+ * \arg \ref VX_TYPE_CONVOLUTION
+ * \arg \ref VX_TYPE_DISTRIBUTION
+ * \arg \ref VX_TYPE_IMAGE
+ * \arg \ref VX_TYPE_LUT
+ * \arg \ref VX_TYPE_MATRIX
+ * \arg \ref VX_TYPE_OBJECT_ARRAY
+ * \arg \ref VX_TYPE_PYRAMID
+ * \arg \ref VX_TYPE_REMAP
+ * \arg \ref VX_TYPE_SCALAR
+ * \arg \ref VX_TYPE_THRESHOLD
+ * \arg \ref VX_TYPE_TENSOR
+ * \param [in] num_slots The number of objects in the delay. This value must be greater than zero.
+ * \returns A delay reference <tt>\ref vx_delay</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_delay
+ */
+VX_API_ENTRY vx_delay VX_API_CALL vxCreateDelay(vx_context context,
+                              vx_reference exemplar,
+                              vx_size num_slots);
+
+/*! \brief Retrieves a reference to a delay slot object.
+ * \param [in] delay The reference to the delay object.
+ * \param [in] index The index of the delay slot from which to extract the object reference.
+ * \return <tt>\ref vx_reference</tt>. Any possible errors preventing a successful
+ * completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \note The delay index is in the range \f$ [-count+1,0] \f$. 0 is always the
+ * \e current object.
+ * \ingroup group_delay
+ * \note A reference retrieved with this function must not be given to its associated
+ * release API (e.g. <tt>\ref vxReleaseImage</tt>) unless <tt>\ref vxRetainReference</tt> is used.
+ */
+VX_API_ENTRY vx_reference VX_API_CALL vxGetReferenceFromDelay(vx_delay delay, vx_int32 index);
+
+/*! \brief Shifts the internal delay ring by one.
+ *
+ * This function performs a shift of the internal delay ring by one. This means that,
+ * the data originally at index 0 move to index -1 and so forth until index
+ * \f$ -count+1 \f$. The data originally at index \f$ -count+1 \f$ move to index 0.
+ * Here \f$ count \f$ is the number of slots in delay ring.
+ * When a delay is aged, any graph making use of this delay (delay object itself or data
+ * objects in delay slots) gets its data automatically updated accordingly.
+ * \param [in] delay
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Delay was aged; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE delay is not a valid <tt>\ref vx_delay</tt> reference.
+ * \ingroup group_delay
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAgeDelay(vx_delay delay);
+
+/*! \brief Register a delay for auto-aging.
+ *
+ * This function registers a delay object to be auto-aged by the graph.
+ * This delay object will be automatically aged after each successful completion of
+ * this graph. Aging of a delay object cannot be called during graph execution.
+ * A graph abandoned due to a node callback will trigger an auto-aging.
+ *
+ * If a delay is registered for auto-aging multiple times in a same graph,
+ * the delay will be only aged a single time at each graph completion.
+ * If a delay is registered for auto-aging in multiple graphs, this delay will
+ * aged automatically after each successful completion of any of these graphs.
+ *
+ * \param [in] graph The graph to which the delay is registered for auto-aging.
+ * \param [in] delay The delay to automatically age.
+ *
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE graph is not a valid <tt>\ref vx_graph</tt> reference, or
+ * delay is not a valid <tt>\ref vx_delay</tt> reference.
+ * \ingroup group_graph
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxRegisterAutoAging(vx_graph graph, vx_delay delay);
+
+/*==============================================================================
+ LOGGING
+ =============================================================================*/
+
+/*! \brief Adds a line to the log.
+ * \param [in] ref The reference to add the log entry against. Some valid value must be provided.
+ * \param [in] status The status code. <tt>\ref VX_SUCCESS</tt> status entries are ignored and not added.
+ * \param [in] message The human readable message to add to the log.
+ * \param [in] ... a list of variable arguments to the message.
+ * \note Messages may not exceed <tt>\ref VX_MAX_LOG_MESSAGE_LEN</tt> bytes and will be truncated in the log if they exceed this limit.
+ * \ingroup group_log
+ */
+VX_API_ENTRY void VX_API_CALL vxAddLogEntry(vx_reference ref, vx_status status, const char *message, ...);
+
+/*! \brief Registers a callback facility to the OpenVX implementation to receive error logs.
+ * \param [in] context The overall context to OpenVX.
+ * \param [in] callback The callback function. If NULL, the previous callback is removed.
+ * \param [in] reentrant If reentrancy flag is <tt>\ref vx_true_e</tt>, then the callback may be entered from multiple
+ * simultaneous tasks or threads (if the host OS supports this).
+ * \ingroup group_log
+ */
+VX_API_ENTRY void VX_API_CALL vxRegisterLogCallback(vx_context context, vx_log_callback_f callback, vx_bool reentrant);
+
+/*==============================================================================
+ LUT
+ =============================================================================*/
+
+/*! \brief Creates LUT object of a given type. The value of <tt>\ref VX_LUT_OFFSET</tt> is equal to 0
+ * for data_type = <tt>\ref VX_TYPE_UINT8</tt>, and (vx_uint32)(count/2) for <tt>\ref VX_TYPE_INT16</tt>.
+ * \param [in] context The reference to the context.
+ * \param [in] data_type The type of data stored in the LUT.
+ * \param [in] count The number of entries desired.
+ * \note data_type can only be \ref VX_TYPE_UINT8 or \ref VX_TYPE_INT16. If data_type
+ * is \ref VX_TYPE_UINT8, count should be not greater than 256. If data_type is \ref VX_TYPE_INT16,
+ * count should not be greater than 65536.
+ * \returns An LUT reference <tt>\ref vx_lut</tt>. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_lut
+ */
+VX_API_ENTRY vx_lut VX_API_CALL vxCreateLUT(vx_context context, vx_enum data_type, vx_size count);
+
+/*! \brief Creates an opaque reference to a LUT object with no direct user access.
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] data_type The type of data stored in the LUT.
+ * \param [in] count The number of entries desired.
+ * \see <tt>\ref vxCreateLUT</tt>
+ * \note data_type can only be \ref VX_TYPE_UINT8 or \ref VX_TYPE_INT16. If data_type
+ * is \ref VX_TYPE_UINT8, count should be not greater than 256. If data_type is \ref VX_TYPE_INT16,
+ * count should not be greater than 65536.
+ * \returns An LUT reference <tt>\ref vx_lut</tt>. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_lut
+ */
+VX_API_ENTRY vx_lut VX_API_CALL vxCreateVirtualLUT(vx_graph graph, vx_enum data_type, vx_size count);
+
+/*! \brief Releases a reference to a LUT object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] lut The pointer to the LUT to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE lut is not a valid <tt>\ref vx_lut</tt> reference.
+ * \ingroup group_lut
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseLUT(vx_lut *lut);
+
+/*! \brief Queries attributes from a LUT.
+ * \param [in] lut The LUT to query.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_lut_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE lut is not a valid <tt>\ref vx_lut</tt> reference.
+ * \ingroup group_lut
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryLUT(vx_lut lut, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows the application to copy from/into a LUT object.
+ * \param [in] lut The reference to the LUT object that is the source or the
+ * destination of the copy.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the LUT
+ * object if the copy was requested in write mode. In the user memory, the LUT is
+ * represented as a array with elements of the type corresponding to
+ * <tt>\ref VX_LUT_TYPE</tt>, and with a number of elements equal to the value
+ * returned via <tt>\ref VX_LUT_COUNT</tt>. The accessible memory must be large enough
+ * to contain this array:
+ * accessible memory in bytes >= sizeof(data_element) * count.
+ * \param [in] usage This declares the effect of the copy with regard to the LUT object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the LUT object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the LUT object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE lut is not a valid <tt>\ref vx_lut</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_lut
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyLUT(vx_lut lut, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+/*! \brief Allows the application to get direct access to LUT object.
+ * \param [in] lut The reference to the LUT object to map.
+ * \param [out] map_id The address of a <tt>\ref vx_map_id</tt> variable where the function
+ * returns a map identifier.
+ * \arg (*map_id) must eventually be provided as the map_id parameter of a call to
+ * <tt>\ref vxUnmapLUT</tt>.
+ * \param [out] ptr The address of a pointer that the function sets to the
+ * address where the requested data can be accessed. In the mapped memory area,
+ * the LUT data are structured as an array with elements of the type corresponding
+ * to <tt>\ref VX_LUT_TYPE</tt>, with a number of elements equal to
+ * the value returned via <tt>\ref VX_LUT_COUNT</tt>. Accessing the
+ * memory out of the bound of this array is forbidden and has an undefined behavior.
+ * The returned (*ptr) address is only valid between the call to the function and
+ * the corresponding call to <tt>\ref vxUnmapLUT</tt>.
+ * \param [in] usage This declares the access mode for the LUT, using
+ * the <tt>\ref vx_accessor_e</tt> enumeration.
+ * \arg <tt>\ref VX_READ_ONLY</tt>: after the function call, the content of the memory location
+ * pointed by (*ptr) contains the LUT data. Writing into this memory location
+ * is forbidden and its behavior is undefined.
+ * \arg <tt>\ref VX_READ_AND_WRITE</tt>: after the function call, the content of the memory
+ * location pointed by (*ptr) contains the LUT data; writing into this memory
+ * is allowed only for the location of entries and will result in a modification
+ * of the affected entries in the LUT object once the LUT is unmapped.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt>: after the function call, the memory location pointed by(*ptr)
+ * contains undefined data; writing each entry of LUT is required prior to
+ * unmapping. Entries not written by the application before unmap will become
+ * undefined after unmap, even if they were well defined before map.
+ * \param [in] mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory where the LUT is requested to be mapped.
+ * \param [in] flags An integer that allows passing options to the map operation.
+ * Use 0 for this option.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE lut is not a valid <tt>\ref vx_lut</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_lut
+ * \post <tt>\ref vxUnmapLUT </tt> with same (*map_id) value.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxMapLUT(vx_lut lut, vx_map_id *map_id, void **ptr, vx_enum usage, vx_enum mem_type, vx_bitfield flags);
+
+/*! \brief Unmap and commit potential changes to LUT object that was previously mapped.
+ * Unmapping a LUT invalidates the memory location from which the LUT data could
+ * be accessed by the application. Accessing this memory location after the unmap function
+ * completes has an undefined behavior.
+ * \param [in] lut The reference to the LUT object to unmap.
+ * \param [out] map_id The unique map identifier that was returned when calling
+ * <tt>\ref vxMapLUT</tt> .
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE lut is not a valid <tt>\ref vx_lut</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_lut
+ * \pre <tt>\ref vxMapLUT</tt> returning the same map_id value
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxUnmapLUT(vx_lut lut, vx_map_id map_id);
+
+/*==============================================================================
+ DISTRIBUTION
+ =============================================================================*/
+
+/*! \brief Creates a reference to a 1D Distribution of a consecutive interval [offset, offset + range - 1]
+ * defined by a start offset and valid range, divided equally into numBins parts.
+ * \param [in] context The reference to the overall context.
+ * \param [in] numBins The number of bins in the distribution.
+ * \param [in] offset The start offset into the range value that marks the begining of the 1D Distribution.
+ * \param [in] range  The total number of the consecutive values of the distribution interval.
+ * \returns A distribution reference <tt>\ref vx_distribution</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_distribution
+ */
+VX_API_ENTRY vx_distribution VX_API_CALL vxCreateDistribution(vx_context context, vx_size numBins, vx_int32 offset, vx_uint32 range);
+
+/*! \brief Creates an opaque reference to a 1D Distribution object without direct user access.
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] numBins The number of bins in the distribution.
+ * \param [in] offset The start offset into the range value that marks the begining of the 1D Distribution.
+ * \param [in] range  The total number of the consecutive values of the distribution interval.
+ * \see <tt>\ref vxCreateDistribution</tt>
+ * \returns A distribution reference <tt>\ref vx_distribution</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_distribution
+ */
+VX_API_ENTRY vx_distribution VX_API_CALL vxCreateVirtualDistribution(vx_graph graph, vx_size numBins, vx_int32 offset, vx_uint32 range);
+
+/*! \brief Releases a reference to a distribution object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] distribution The reference to the distribution to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE distribution is not a valid <tt>\ref vx_distribution</tt> reference.
+ * \ingroup group_distribution
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseDistribution(vx_distribution *distribution);
+
+/*! \brief Queries a Distribution object.
+ * \param [in] distribution The reference to the distribution to query.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_distribution_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE distribution is not a valid <tt>\ref vx_distribution</tt> reference.
+ * \ingroup group_distribution
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryDistribution(vx_distribution distribution, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows the application to copy from/into a distribution object.
+ * \param [in] distribution The reference to the distribution object that is the source or the
+ * destination of the copy.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the distribution
+ * object if the copy was requested in write mode. In the user memory, the distribution is
+ * represented as a <tt>\ref vx_uint32</tt> array with a number of elements equal to the value returned via
+ * <tt>\ref VX_DISTRIBUTION_BINS</tt>. The accessible memory must be large enough
+ * to contain this vx_uint32 array:
+ * accessible memory in bytes >= sizeof(vx_uint32) * num_bins.
+ * \param [in] usage This declares the effect of the copy with regard to the distribution object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the distribution object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the distribution object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE distribution is not a valid <tt>\ref vx_distribution</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_distribution
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyDistribution(vx_distribution distribution, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+/*! \brief Allows the application to get direct access to distribution object.
+ * \param [in] distribution The reference to the distribution object to map.
+ * \param [out] map_id The address of a <tt>\ref vx_map_id</tt> variable where the function
+ * returns a map identifier.
+ * \arg (*map_id) must eventually be provided as the map_id parameter of a call to
+ * <tt>\ref vxUnmapDistribution</tt>.
+ * \param [out] ptr The address of a pointer that the function sets to the
+ * address where the requested data can be accessed. In the mapped memory area,
+ * data are structured as a vx_uint32 array with a number of elements equal to
+ * the value returned via <tt>\ref VX_DISTRIBUTION_BINS</tt>. Each
+ * element of this array corresponds to a bin of the distribution, with a range-major
+ * ordering. Accessing the memory out of the bound of this array
+ * is forbidden and has an undefined behavior. The returned (*ptr) address
+ * is only valid between the call to the function and the corresponding call to
+ * <tt>\ref vxUnmapDistribution</tt>.
+ * \param [in] usage This declares the access mode for the distribution, using
+ * the <tt>\ref vx_accessor_e</tt> enumeration.
+ * \arg <tt>\ref VX_READ_ONLY</tt>: after the function call, the content of the memory location
+ * pointed by (*ptr) contains the distribution data. Writing into this memory location
+ * is forbidden and its behavior is undefined.
+ * \arg <tt>\ref VX_READ_AND_WRITE</tt>: after the function call, the content of the memory
+ * location pointed by (*ptr) contains the distribution data; writing into this memory
+ * is allowed only for the location of bins and will result in a modification of the
+ * affected bins in the distribution object once the distribution is unmapped.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt>: after the function call, the memory location pointed by (*ptr)
+ * contains undefined data; writing each bin of distribution is required prior to
+ * unmapping. Bins not written by the application before unmap will become
+ * undefined after unmap, even if they were well defined before map.
+ * \param [in] mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory where the distribution is requested to be mapped.
+ * \param [in] flags An integer that allows passing options to the map operation.
+ * Use 0 for this option.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE distribution is not a valid <tt>\ref vx_distribution</tt> reference.
+ * reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_distribution
+ * \post <tt>\ref vxUnmapDistribution </tt> with same (*map_id) value.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxMapDistribution(vx_distribution distribution, vx_map_id *map_id, void **ptr, vx_enum usage, vx_enum mem_type, vx_bitfield flags);
+
+/*! \brief Unmap and commit potential changes to distribution object that was previously mapped.
+ * Unmapping a distribution invalidates the memory location from which the distribution data
+ * could be accessed by the application. Accessing this memory location after the unmap
+ * function completes has an undefined behavior.
+ * \param [in] distribution The reference to the distribution object to unmap.
+ * \param [out] map_id The unique map identifier that was returned when calling
+ * <tt>\ref vxMapDistribution</tt> .
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE distribution is not a valid <tt>\ref vx_distribution</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_distribution
+ * \pre <tt>\ref vxMapDistribution</tt> returning the same map_id value
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxUnmapDistribution(vx_distribution distribution, vx_map_id map_id);
+
+
+/*==============================================================================
+ THRESHOLD
+ =============================================================================*/
+
+/*! \brief Creates a threshold object and returns a reference to it.
+ *
+ * The threshold object defines the parameters of a thresholding operation
+ * to an input image, that generates an output image that can have a different
+ * format. The thresholding 'false' or 'true' output values are specified per
+ * pixel channels of the output format and can be modified with
+ * <tt>\ref vxCopyThresholdOutput</tt>. The default 'false' output value of
+ * pixels channels should be 0, and the default 'true' value should be non-zero.
+ * For standard image formats, default output pixel values are defined as
+ * following:
+ *  \arg \ref VX_DF_IMAGE_RGB : false={0, 0, 0}, true={255,255,255}
+ *  \arg \ref VX_DF_IMAGE_RGBX : false={0, 0, 0, 0}, true={255,255,255,255}
+ *  \arg \ref VX_DF_IMAGE_NV12 : false={0, 0, 0}, true={255,255,255}
+ *  \arg \ref VX_DF_IMAGE_NV21 : false={0, 0, 0}, true={255,255,255}
+ *  \arg \ref VX_DF_IMAGE_UYVY : false={0, 0, 0}, true={255,255,255}
+ *  \arg \ref VX_DF_IMAGE_YUYV : false={0, 0, 0}, true={255,255,255}
+ *  \arg \ref VX_DF_IMAGE_IYUV : false={0, 0, 0}, true={255,255,255}
+ *  \arg \ref VX_DF_IMAGE_YUV4 : false={0, 0, 0}, true={255,255,255}
+ *  \arg \ref VX_DF_IMAGE_U8 : false=0, true=0xFF
+ *  \arg \ref VX_DF_IMAGE_S16 : false=0, true=-1
+ *  \arg \ref VX_DF_IMAGE_U16 : false=0, true=0xFFFF
+ *  \arg \ref VX_DF_IMAGE_S32 : false=0, true=-1
+ *  \arg \ref VX_DF_IMAGE_U32 : false=0, true=0xFFFFFFFF
+ * \param [in] context The reference to the context in which the object is
+ * created.
+ * \param [in] thresh_type The type of thresholding operation.
+ * \param [in] input_format The format of images that will be used as input of
+ * the thresholding operation.
+ * \param [in] output_format The format of images that will be generated by the
+ * thresholding operation.
+ * \returns A threshold reference <tt>\ref vx_threshold</tt>. Any possible
+ * errors preventing a successful creation should be checked using
+ * <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_threshold
+ */
+VX_API_ENTRY vx_threshold VX_API_CALL vxCreateThresholdForImage(vx_context context,
+                                                                vx_enum thresh_type,
+                                                                vx_df_image input_format,
+                                                                vx_df_image output_format);
+
+/*! \brief Creates an opaque reference to a threshold object without direct user access.
+ * 
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] thresh_type The type of thresholding operation.
+ * \param [in] input_format The format of images that will be used as input of
+ * the thresholding operation.
+ * \param [in] output_format The format of images that will be generated by the
+ * thresholding operation.
+ * \see <tt>\ref vxCreateThresholdForImage</tt>
+ * \returns A threshold reference <tt>\ref vx_threshold</tt>. Any possible
+ * errors preventing a successful creation should be checked using
+ * <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_threshold
+ */
+VX_API_ENTRY vx_threshold VX_API_CALL vxCreateVirtualThresholdForImage(vx_graph graph,
+                                                                       vx_enum thresh_type,
+                                                                       vx_df_image input_format,
+                                                                       vx_df_image output_format);
+
+/*! \brief Allows the application to copy the thresholding value from/into a
+ * threshold object with type <tt>\ref VX_THRESHOLD_TYPE_BINARY</tt>.
+ * \param [in] thresh The reference to the threshold object that is the source
+ * or the destination of the copy.
+ * \param [in,out] value_ptr The address of the memory location where to store
+ * the thresholding value if the copy was requested in read mode, or from where
+ * to get the thresholding value to store into the threshold object if the copy
+ * was requested in write mode.
+ * \param [in] usage This declares the effect of the copy with regard to the
+ * threshold object using the <tt>\ref vx_accessor_e</tt> enumeration. Only
+ * <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt> are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that the thresholding value is copied
+ * from the threshold object into the user memory. After the copy, only the
+ * field of the (*value_ptr) union that corresponds to the input image format
+ * of the threshold object is meaningful.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means the field of the (*value_ptr) union
+ * corresponding  to the input format of the threshold object is copied into
+ * the threshold object.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory referenced by \p value_ptr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_ERROR_INVALID_REFERENCE The threshold reference is not actually a
+ * threshold reference.
+ * \retval VX_ERROR_NOT_COMPATIBLE The threshold object doesn't have type
+ * <tt>\ref VX_THRESHOLD_TYPE_BINARY</tt>
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_threshold
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyThresholdValue(vx_threshold thresh,
+                                                        vx_pixel_value_t * value_ptr,
+                                                        vx_enum usage,
+                                                        vx_enum user_mem_type
+                                                        );
+
+/*! \brief Allows the application to copy thresholding values from/into a
+ * threshold object with type <tt>\ref VX_THRESHOLD_TYPE_RANGE</tt>.
+ * \param [in] thresh The reference to the threshold object that is the source
+ * or the destination of the copy.
+ * \param [in,out] lower_value_ptr The address of the memory location where to
+ * store the lower thresholding value if the copy was requested in read mode,
+ * or from where to get the lower thresholding value to store into the threshold
+ * object if the copy was requested in write mode.
+ * \param [in,out] upper_value_ptr The address of the memory location where to
+ * store the upper thresholding value if the copy was requested in read mode, or
+ * from where to get the upper thresholding value to store into the threshold
+ * object if the copy was requested in write mode.
+ * \param [in] usage This declares the effect of the copy with regard to the
+ * threshold object using the <tt>\ref vx_accessor_e</tt> enumeration. Only
+ * <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt> are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that thresholding values are copied
+ * from the threshold object into the user memory. After the copy, only the
+ * field of (*lower_value_ptr) and (*upper_value_ptr) unions that corresponds
+ * to the input image format of the threshold object is meaningful.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means the field of the (*lower_value_ptr)
+ * and (*upper_value_ptr) unions corresponding to the input format of the
+ * threshold object is copied into the threshold object.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory referenced by \p lower_value_ptr and
+ * \p upper_value_ptr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_ERROR_INVALID_REFERENCE The threshold reference is not actually
+ * a threshold reference.
+ * \retval VX_ERROR_NOT_COMPATIBLE The threshold object doesn't have type
+ * <tt>\ref VX_THRESHOLD_TYPE_RANGE</tt>
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_threshold
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyThresholdRange(vx_threshold thresh,
+                                                        vx_pixel_value_t * lower_value_ptr,
+                                                        vx_pixel_value_t * upper_value_ptr,
+                                                        vx_enum usage,
+                                                        vx_enum user_mem_type);
+
+/*! \brief Allows the application to copy the true and false output values
+ * from/into a threshold object.
+ * \param [in] thresh The reference to the threshold object that is the source
+ * or the destination of the copy.
+ * \param [in,out] true_value_ptr The address of the memory location where to
+ * store the true output value if the copy was requested in read mode,
+ * or from where to get the true output value to store into the threshold
+ * object if the copy was requested in write mode.
+ * \param [in,out] false_value_ptr The address of the memory location where to
+ * store the false output value if the copy was requested in read mode, or
+ * from where to get the false output value to store into the threshold
+ * object if the copy was requested in write mode.
+ * \param [in] usage This declares the effect of the copy with regard to the
+ * threshold object using the <tt>\ref vx_accessor_e</tt> enumeration. Only
+ * <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt> are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that true and false output values
+ * are copied from the threshold object into the user memory. After the copy,
+ * only the field of (*true_value_ptr) and (*false_value_ptr) unions that
+ * corresponds to the output image format of the threshold object is meaningful.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means the field of the (*true_value_ptr)
+ * and (*false_value_ptr) unions corresponding to the output format of the
+ * threshold object is copied into the threshold object.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory referenced by \p true_value_ptr and
+ * \p false_value_ptr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_ERROR_INVALID_REFERENCE The threshold reference is not actually
+ * a threshold reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_threshold
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyThresholdOutput(vx_threshold thresh,
+                                                         vx_pixel_value_t * true_value_ptr,
+                                                         vx_pixel_value_t * false_value_ptr,
+                                                         vx_enum usage,
+                                                         vx_enum user_mem_type);
+
+/*! \brief Releases a reference to a threshold object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] thresh The pointer to the threshold to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE thresh is not a valid <tt>\ref vx_threshold</tt> reference.
+ * \ingroup group_threshold
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseThreshold(vx_threshold *thresh);
+
+/*! \brief Sets attributes on the threshold object.
+ * \param [in] thresh The threshold object to set.
+ * \param [in] attribute The attribute to modify. Use a <tt>\ref vx_threshold_attribute_e</tt> enumeration.
+ * \param [in] ptr The pointer to the value to which to set the attribute.
+ * \param [in] size The size of the data pointed to by \a ptr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE thresh is not a valid <tt>\ref vx_threshold</tt> reference.
+ * \ingroup group_threshold
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetThresholdAttribute(vx_threshold thresh, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Queries an attribute on the threshold object.
+ * \param [in] thresh The threshold object to set.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_threshold_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE thresh is not a valid <tt>\ref vx_threshold</tt> reference.
+ * \ingroup group_threshold
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryThreshold(vx_threshold thresh, vx_enum attribute, void *ptr, vx_size size);
+
+/*==============================================================================
+ MATRIX
+ =============================================================================*/
+
+/*! \brief Creates a reference to a matrix object.
+ * \param [in] c The reference to the overall context.
+ * \param [in] data_type The unit format of the matrix. <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT32</tt> or <tt>\ref VX_TYPE_FLOAT32</tt>.
+ * \param [in] columns The first dimensionality.
+ * \param [in] rows The second dimensionality.
+ * \returns An matrix reference <tt>\ref vx_matrix</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_matrix
+ */
+VX_API_ENTRY vx_matrix VX_API_CALL vxCreateMatrix(vx_context c, vx_enum data_type, vx_size columns, vx_size rows);
+
+/*! \brief Creates an opaque reference to a matrix object without direct user access.
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] data_type The unit format of the matrix. <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT32</tt> or <tt>\ref VX_TYPE_FLOAT32</tt>.
+ * \param [in] columns The first dimensionality.
+ * \param [in] rows The second dimensionality.
+ * \see <tt>\ref vxCreateMatrix</tt>
+ * \returns An matrix reference <tt>\ref vx_matrix</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_matrix
+ */
+VX_API_ENTRY vx_matrix VX_API_CALL vxCreateVirtualMatrix(vx_graph graph, vx_enum data_type, vx_size columns, vx_size rows);
+
+/*! \brief Releases a reference to a matrix object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] mat The matrix reference to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE mat is not a valid <tt>\ref vx_matrix</tt> reference.
+ * \ingroup group_matrix
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseMatrix(vx_matrix *mat);
+
+/*! \brief Queries an attribute on the matrix object.
+ * \param [in] mat The matrix object to set.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_matrix_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE mat is not a valid <tt>\ref vx_matrix</tt> reference.
+ * \ingroup group_matrix
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryMatrix(vx_matrix mat, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Allows the application to copy from/into a matrix object.
+ * \param [in] matrix The reference to the matrix object that is the source or the
+ * destination of the copy.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the matrix
+ * object if the copy was requested in write mode. In the user memory, the matrix is
+ * structured as a row-major 2D array with elements of the type corresponding to
+ * <tt>\ref VX_MATRIX_TYPE</tt>, with a number of rows corresponding to
+ * <tt>\ref VX_MATRIX_ROWS</tt> and a number of columns corresponding to
+ * <tt>\ref VX_MATRIX_COLUMNS</tt>. The accessible memory must be large
+ * enough to contain this 2D array:
+ * accessible memory in bytes >= sizeof(data_element) * rows * columns.
+ * \param [in] usage This declares the effect of the copy with regard to the matrix object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the matrix object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the matrix object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE matrix is not a valid <tt>\ref vx_matrix</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_matrix
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyMatrix(vx_matrix matrix, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+/*! \brief Creates a reference to a matrix object from a boolean pattern.
+ * \see <tt>\ref vxCreateMatrixFromPatternAndOrigin</tt> for a description of the matrix patterns.
+ * \param [in] context The reference to the overall context.
+ * \param [in] pattern The pattern of the matrix. See <tt>\ref VX_MATRIX_PATTERN</tt>.
+ * \param [in] columns The first dimensionality.
+ * \param [in] rows The second dimensionality.
+ * \returns A matrix reference <tt>\ref vx_matrix</tt> of type <tt>\ref VX_TYPE_UINT8</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_matrix
+ */
+VX_API_ENTRY vx_matrix VX_API_CALL vxCreateMatrixFromPattern(vx_context context, vx_enum pattern, vx_size columns, vx_size rows);
+
+/*! \brief Creates a reference to a matrix object from a boolean pattern, with a user-specified origin.
+ *
+ * The matrix created by this function is of type <tt>\ref VX_TYPE_UINT8</tt>, with the value 0 representing False,
+ * and the value 255 representing True. It supports the patterns as described below:
+ * - VX_PATTERN_BOX is a matrix with dimensions equal to the given number of rows and columns, and all cells equal to 255.
+ *   Dimensions of 3x3 and 5x5 must be supported.
+ * - VX_PATTERN_CROSS is a matrix with dimensions equal to the given number of rows and columns, which both must be odd numbers.
+ *   All cells in the center row and center column are equal to 255, and the rest are equal to zero.
+ *   Dimensions of 3x3 and 5x5 must be supported.
+ * - VX_PATTERN_DISK is a matrix with dimensions equal to the given number of rows (R) and columns (C),
+ *   where R and C are odd and cell (c, r) is 255 if: \n
+ *   (r-R/2 + 0.5)^2 / (R/2)^2 + (c-C/2 + 0.5)^2/(C/2)^2 is less than or equal to 1,\n and 0 otherwise.
+ *
+ * A matrix created from pattern is read-only. The behavior when attempting to modify such a matrix is undefined.
+ *
+ * \param [in] context The reference to the overall context.
+ * \param [in] pattern The pattern of the matrix. See <tt>\ref VX_MATRIX_PATTERN</tt>.
+ * \param [in] columns The first dimensionality.
+ * \param [in] rows The second dimensionality.
+ * \param [in] origin_col The origin (first dimensionality).
+ * \param [in] origin_row The origin (second dimensionality).
+ * \returns A matrix reference <tt>\ref vx_matrix</tt> of type <tt>\ref VX_TYPE_UINT8</tt>. Any possible errors
+ * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_matrix
+ */
+VX_API_ENTRY vx_matrix VX_API_CALL vxCreateMatrixFromPatternAndOrigin(vx_context context, vx_enum pattern, vx_size columns, vx_size rows, vx_size origin_col, vx_size origin_row);
+
+
+/*==============================================================================
+ CONVOLUTION
+ =============================================================================*/
+
+/*! \brief Creates a reference to a convolution matrix object.
+ * \param [in] context The reference to the overall context.
+ * \param [in] columns The columns dimension of the convolution.
+ * Must be odd and greater than or equal to 3 and less than the value returned
+ * from <tt>\ref VX_CONTEXT_CONVOLUTION_MAX_DIMENSION</tt>.
+ * \param [in] rows The rows dimension of the convolution.
+ * Must be odd and greater than or equal to 3 and less than the value returned
+ * from <tt>\ref VX_CONTEXT_CONVOLUTION_MAX_DIMENSION</tt>.
+ * \returns A convolution reference <tt>\ref vx_convolution</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_convolution
+ */
+VX_API_ENTRY vx_convolution VX_API_CALL vxCreateConvolution(vx_context context, vx_size columns, vx_size rows);
+
+/*! \brief Creates an opaque reference to a convolution matrix object without direct user access.
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] columns The columns dimension of the convolution.
+ * Must be odd and greater than or equal to 3 and less than the value returned
+ * from <tt>\ref VX_CONTEXT_CONVOLUTION_MAX_DIMENSION</tt>.
+ * \param [in] rows The rows dimension of the convolution.
+ * Must be odd and greater than or equal to 3 and less than the value returned
+ * from <tt>\ref VX_CONTEXT_CONVOLUTION_MAX_DIMENSION</tt>.
+ * \see <tt>\ref vxCreateConvolution</tt>
+ * \returns A convolution reference <tt>\ref vx_convolution</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_convolution
+ */
+VX_API_ENTRY vx_convolution VX_API_CALL vxCreateVirtualConvolution(vx_graph graph, vx_size columns, vx_size rows);
+
+/*! \brief Releases the reference to a convolution matrix.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] conv The pointer to the convolution matrix to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE conv is not a valid <tt>\ref vx_convolution</tt> reference.
+ * \ingroup group_convolution
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseConvolution(vx_convolution *conv);
+
+/*! \brief Queries an attribute on the convolution matrix object.
+ * \param [in] conv The convolution matrix object to set.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_convolution_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE conv is not a valid <tt>\ref vx_convolution</tt> reference.
+ * \ingroup group_convolution
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryConvolution(vx_convolution conv, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Sets attributes on the convolution object.
+ * \param [in] conv The coordinates object to set.
+ * \param [in] attribute The attribute to modify. Use a <tt>\ref vx_convolution_attribute_e</tt> enumeration.
+ * \param [in] ptr The pointer to the value to which to set the attribute.
+ * \param [in] size The size in bytes of the data pointed to by \a ptr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE conv is not a valid <tt>\ref vx_convolution</tt> reference.
+ * \ingroup group_convolution
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetConvolutionAttribute(vx_convolution conv, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Allows the application to copy coefficients from/into a convolution object.
+ * \param [in] conv The reference to the convolution object that is the source or the destination of the copy.
+ * \param [in] user_ptr The address of the memory location where to store the requested
+ * coefficient data if the copy was requested in read mode, or from where to get the
+ * coefficient data to store into the convolution object if the copy was requested in
+ * write mode. In the user memory, the convolution coefficient data is structured as a
+ * row-major 2D array with elements of the type corresponding
+ * to <tt>\ref VX_TYPE_CONVOLUTION</tt>, with a number of rows corresponding to
+ * <tt>\ref VX_CONVOLUTION_ROWS</tt> and a number of columns corresponding to
+ * <tt>\ref VX_CONVOLUTION_COLUMNS</tt>. The accessible memory must be large
+ * enough to contain this 2D array:
+ * accessible memory in bytes >= sizeof(data_element) * rows * columns.
+ * \param [in] usage This declares the effect of the copy with regard to the convolution object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the convolution object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the convolution object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE conv is not a valid <tt>\ref vx_convolution</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_convolution
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyConvolutionCoefficients(vx_convolution conv, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+
+/*==============================================================================
+ PYRAMID
+ =============================================================================*/
+
+/*! \brief Creates a reference to a pyramid object of the supplied number of levels.
+ * \param [in] context The reference to the overall context.
+ * \param [in] levels The number of levels desired. This is required to be a non-zero value.
+ * \param [in] scale Used to indicate the scale between pyramid levels. This is required to be a non-zero positive value.
+ * <tt>\ref VX_SCALE_PYRAMID_HALF</tt> and <tt>\ref VX_SCALE_PYRAMID_ORB</tt> must be supported.
+ * \param [in] width The width of the 0th level image in pixels.
+ * \param [in] height The height of the 0th level image in pixels.
+ * \param [in] format The format of all images in the pyramid. NV12, NV21, IYUV, UYVY and YUYV formats are not supported.
+ * \returns A pyramid reference <tt>\ref vx_pyramid</tt> containing the sub-images. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_pyramid
+ */
+VX_API_ENTRY vx_pyramid VX_API_CALL vxCreatePyramid(vx_context context, vx_size levels, vx_float32 scale, vx_uint32 width, vx_uint32 height, vx_df_image format);
+
+/*! \brief Creates a reference to a virtual pyramid object of the supplied number of levels.
+ * \details Virtual Pyramids can be used to connect Nodes together when the contents of the pyramids will
+ * not be accessed by the user of the API.
+ * All of the following constructions are valid:
+ * \code
+ * vx_context context = vxCreateContext();
+ * vx_graph graph = vxCreateGraph(context);
+ * vx_pyramid virt[] = {
+ *     vxCreateVirtualPyramid(graph, 4, VX_SCALE_PYRAMID_HALF, 0, 0, VX_DF_IMAGE_VIRT), // no dimension and format specified for level 0
+ *     vxCreateVirtualPyramid(graph, 4, VX_SCALE_PYRAMID_HALF, 640, 480, VX_DF_IMAGE_VIRT), // no format specified.
+ *     vxCreateVirtualPyramid(graph, 4, VX_SCALE_PYRAMID_HALF, 640, 480, VX_DF_IMAGE_U8), // no access
+ * };
+ * \endcode
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] levels The number of levels desired. This is required to be a non-zero value.
+ * \param [in] scale Used to indicate the scale between pyramid levels. This is required to be a non-zero positive value.
+ * <tt>\ref VX_SCALE_PYRAMID_HALF</tt> and <tt>\ref VX_SCALE_PYRAMID_ORB</tt> must be supported.
+ * \param [in] width The width of the 0th level image in pixels. This may be set to zero to indicate to the interface that the value is unspecified.
+ * \param [in] height The height of the 0th level image in pixels. This may be set to zero to indicate to the interface that the value is unspecified.
+ * \param [in] format The format of all images in the pyramid. This may be set to <tt>\ref VX_DF_IMAGE_VIRT</tt> to indicate that the format is unspecified.
+ * \returns A pyramid reference <tt>\ref vx_pyramid</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \note Images extracted with <tt>\ref vxGetPyramidLevel</tt> behave as Virtual Images and
+ * cause <tt>\ref vxMapImagePatch</tt> to return errors.
+ * \ingroup group_pyramid
+ */
+VX_API_ENTRY vx_pyramid VX_API_CALL vxCreateVirtualPyramid(vx_graph graph, vx_size levels, vx_float32 scale, vx_uint32 width, vx_uint32 height, vx_df_image format);
+
+
+/*! \brief Releases a reference to a pyramid object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] pyr The pointer to the pyramid to release.
+ * \ingroup group_pyramid
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE pyr is not a valid <tt>\ref vx_pyramid</tt> reference.
+ * \post After returning from this function the reference is zeroed.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleasePyramid(vx_pyramid *pyr);
+
+/*! \brief Queries an attribute from an image pyramid.
+ * \param [in] pyr The pyramid to query.
+ * \param [in] attribute The attribute for which to query. Use a <tt>\ref vx_pyramid_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE pyr is not a valid <tt>\ref vx_pyramid</tt> reference.
+ * \ingroup group_pyramid
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryPyramid(vx_pyramid pyr, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Retrieves a level of the pyramid as a <tt>\ref vx_image</tt>, which can be used
+ * elsewhere in OpenVX. A call to vxReleaseImage is necessary to release an image for each
+ * call of vxGetPyramidLevel.
+ * \param [in] pyr The pyramid object.
+ * \param [in] index The index of the level, such that index is less than levels.
+ * \return A <tt>\ref vx_image</tt> reference. Any possible errors preventing a successful
+ * function completion should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_pyramid
+ */
+VX_API_ENTRY vx_image VX_API_CALL vxGetPyramidLevel(vx_pyramid pyr, vx_uint32 index);
+
+/*==============================================================================
+ REMAP
+ =============================================================================*/
+
+/*! \brief Creates a remap table object.
+ * \param [in] context The reference to the overall context.
+ * \param [in] src_width Width of the source image in pixel.
+ * \param [in] src_height Height of the source image in pixels.
+ * \param [in] dst_width Width of the destination image in pixels.
+ * \param [in] dst_height Height of the destination image in pixels.
+ * \ingroup group_remap
+ * \returns A remap reference <tt>\ref vx_remap</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_remap VX_API_CALL vxCreateRemap(vx_context context,
+                              vx_uint32 src_width,
+                              vx_uint32 src_height,
+                              vx_uint32 dst_width,
+                              vx_uint32 dst_height);
+
+/*! \brief Creates an opaque reference to a remap table object without direct user access.
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] src_width Width of the source image in pixel.
+ * \param [in] src_height Height of the source image in pixels.
+ * \param [in] dst_width Width of the destination image in pixels.
+ * \param [in] dst_height Height of the destination image in pixels.
+ * \see <tt>\ref vxCreateRemap</tt>
+ * \ingroup group_remap
+ * \returns A remap reference <tt>\ref vx_remap</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_remap VX_API_CALL vxCreateVirtualRemap(vx_graph graph,
+                              vx_uint32 src_width,
+                              vx_uint32 src_height,
+                              vx_uint32 dst_width,
+                              vx_uint32 dst_height);
+
+/*! \brief Releases a reference to a remap table object. The object may not be
+ * garbage collected until its total reference count is zero.
+ * \param [in] table The pointer to the remap table to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE table is not a valid <tt>\ref vx_remap</tt> reference.
+ * \ingroup group_remap
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseRemap(vx_remap *table);
+
+/*! \brief Allows the application to get direct access to a rectangular patch of a remap object.
+ *
+ * The patch is specified within the destination dimensions and its
+ * data provide the corresponding coordinate within the source dimensions.
+ * The patch is mapped as a 2D array of elements of the type associated
+ * with the \p coordinate_type parameter (i.e., <tt>\ref vx_coordinates2df_t</tt>
+ * for <tt>\ref VX_TYPE_COORDINATES2DF</tt>).
+ * The memory layout of the mapped 2D array follows a row-major order where rows are
+ * compact (without any gap between elements), and where the potential
+ * padding after each lines is determined by (* \p stride_y).
+ *
+ * \param [in] remap The reference to the remap object that contains the
+ * patch to map.
+ *
+ * \param [in] rect The coordinates of remap patch. The patch must be specified
+ * within the bounds of the remap destination dimensions
+ * (<tt>\ref VX_REMAP_DESTINATION_WIDTH</tt> x <tt>\ref VX_REMAP_DESTINATION_HEIGHT</tt>).
+ * (start_x, start_y) gives the coordinate of the topleft element inside the patch,
+ * while (end_x, end_y) gives the coordinate of the bottomright element out of the patch.
+ *
+ * \param [out] map_id The address of a <tt>\ref vx_map_id</tt> variable
+ * where the function returns a map identifier.
+ * \arg (*map_id) must eventually be provided as the map_id parameter of a call
+ * to <tt>\ref vxUnmapRemapPatch</tt>.
+ *
+ * \param [out] stride_y The address of a vx_size variable where the function
+ * returns the difference between the address of the first element of two
+ * successive lines in the mapped remap patch. The stride value follows the
+ * following rule :
+ * (*stride_y) >= sizeof(<ELEMENT_TYPE>) * (rect->end_x - rect->start_x)
+ *
+ * \param [out] ptr The address of a pointer where the function returns where
+ * remap patch data can be accessed. (*ptr) is the address of the the top-left
+ * element of the remap patch.
+ * The returned (*ptr) address is only valid between the call to this function
+ * and the corresponding call to <tt>\ref vxUnmapRemapPatch</tt>.
+ *
+ * \param [in] coordinate_type This declares the type of the source coordinate
+ * data that the application wants to access in the remap patch.
+ * It must be <tt>\ref VX_TYPE_COORDINATES2DF</tt>.
+ *
+ * \param [in] usage This declares the access mode for the remap patch, using
+ * the <tt>\ref vx_accessor_e</tt> enumeration.
+ * \arg <tt>\ref VX_READ_ONLY</tt>: after the function call, the content of the
+ * memory location pointed by (*ptr) contains the remap patch data. Writing into
+ * this memory location is forbidden and its behavior is undefined.
+ * \arg <tt>\ref VX_READ_AND_WRITE</tt>: after the function call, the content of
+ * the memory location pointed by (*ptr) contains the remap patch data; writing
+ * into this memory is allowed for the location of elements only and will
+ * result in a modification of the written elements in the remap object once the
+ * patch is unmapped. Writing into a gap between element lines
+ * (when (*stride_y) > sizeof(<ELEMENT_TYPE>) * (rect->end_x - rect->start_x))
+ * is forbidden and its behavior is undefined.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt>: after the function call, the memory location
+ * pointed by (*ptr) contains undefined data; writing each element of the patch is
+ * required prior to unmapping. Elements not written by the application before
+ * unmap will become undefined after unmap, even if they were well defined before
+ * map. Like for <tt>\ref VX_READ_AND_WRITE</tt>, writing into a gap between
+ * element lines is forbidden and its behavior is undefined.
+ *
+ * \param [in] mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory where the remap patch is requested to be mapped.
+ *
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE remap is not a valid <tt>\ref vx_remap</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ *
+ * \ingroup group_remap
+ * \post <tt>\ref vxUnmapRemapPatch </tt> with same (*map_id) value.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxMapRemapPatch(vx_remap remap,
+                                                   const vx_rectangle_t *rect,
+                                                   vx_map_id *map_id,
+                                                   vx_size *stride_y,
+                                                   void **ptr,
+                                                   vx_enum coordinate_type,
+                                                   vx_enum usage,
+                                                   vx_enum mem_type);
+
+/*! \brief Unmap and commit potential changes to a remap object patch that was previously mapped.
+ *
+ * Unmapping a remap patch invalidates the memory location from which the patch could
+ * be accessed by the application. Accessing this memory location after the unmap function
+ * completes has an undefined behavior.
+ * \param [in] remap The reference to the remap object to unmap.
+ * \param [out] map_id The unique map identifier that was returned by <tt>\ref vxMapRemapPatch</tt> .
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE remap is not a valid <tt>\ref vx_remap</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_remap
+ * \pre <tt>\ref vxMapRemapPatch</tt> with same map_id value
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxUnmapRemapPatch(vx_remap remap, vx_map_id map_id);
+
+/*! \brief Allows the application to copy a rectangular patch from/into a remap object.
+ *
+ * The patch is specified within the destination dimensions and its
+ * data provide the corresponding coordinate within the source dimensions.
+ * The patch in user memory is a 2D array of elements of the type associated with the
+ * \p coordinate_type parameter (i.e., <tt>\ref vx_coordinates2df_t</tt> for
+ * <tt>\ref VX_TYPE_COORDINATES2DF</tt>).
+ * The memory layout of this array follows a row-major order where rows are
+ * compact (without any gap between elements), and where the potential padding
+ * after each line is determined by the \p user_stride_y parameter.
+
+ * \param [in] remap The reference to the remap object that is the source or the
+ * destination of the patch copy.
+ *
+ * \param [in] rect The coordinates of remap patch. The patch must be specified
+ * within the bounds of the remap destination dimensions
+ * (<tt>\ref VX_REMAP_DESTINATION_WIDTH</tt> x <tt>\ref VX_REMAP_DESTINATION_HEIGHT</tt>).
+ * (start_x, start_y) gives the coordinate of the topleft element inside the patch,
+ * while (end_x, end_y) gives the coordinate of the bottomright element out of the patch.
+ *
+ * \param [in] user_stride_y The difference between the address of the first element
+ * of two successive lines of the remap patch in user memory (pointed by
+ * \p user_ptr). The layout of the user memory must follow a row major order and user_stride_y
+ * must follow the following rule :
+ *  user_stride_y >= sizeof(<ELEMENT_TYPE>) * (rect->end_x - rect->start_x).
+ *
+ * \param [in] user_ptr The address of the user memory location where to store the requested
+ * remap data if the copy was requested in read mode, or from where to get the remap data to
+ * store into the remap object if the copy was requested in write mode. \p user_ptr is the
+ * address of the the top-left element of the remap patch.
+ * The accessible user memory must be large enough to contain the specified patch with
+ * the specified layout:
+ * accessible memory in bytes >= (rect->end_y - rect->start_y) * user_stride_y.
+ *
+ * \param [in] user_coordinate_type This declares the type of the source coordinate remap
+ * data in the user memory. It must be <tt>\ref VX_TYPE_COORDINATES2DF</tt>.
+ *
+ * \param [in] usage This declares the effect of the copy with regard to the remap object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only VX_READ_ONLY and VX_WRITE_ONLY are
+ * supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data is copied from the remap object into the user
+ * memory pointer by \p user_ptr. The potential padding after each line in user
+ * memory will stay unchanged.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data is copied into the remap object from
+ * the user memory.
+ *
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the type of the memory pointer by \p user_ptr.
+ *
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE remap is not a valid <tt>\ref vx_remap</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ *
+ * \ingroup group_remap
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxCopyRemapPatch(vx_remap remap,
+                                                    const vx_rectangle_t *rect,
+                                                    vx_size user_stride_y,
+                                                    void * user_ptr,
+                                                    vx_enum user_coordinate_type,
+                                                    vx_enum usage,
+                                                    vx_enum user_mem_type);
+
+/*! \brief Queries attributes from a Remap table.
+ * \param [in] table The remap to query.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_remap_attribute_e</tt> enumeration.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE table is not a valid <tt>\ref vx_remap</tt> reference.
+ * \ingroup group_remap
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryRemap(vx_remap table, vx_enum attribute, void *ptr, vx_size size);
+
+/*==============================================================================
+ ARRAY
+ =============================================================================*/
+
+/*!
+ * \brief Creates a reference to an Array object.
+ *
+ * User must specify the Array capacity (i.e., the maximal number of items that the array can hold).
+ *
+ * \param [in] context      The reference to the overall Context.
+ * \param [in] item_type The type of data to hold. Must be greater than
+ * <tt>\ref VX_TYPE_INVALID</tt> and less than or equal to <tt>\ref VX_TYPE_VENDOR_STRUCT_END</tt>.
+ * Or must be a <tt>\ref vx_enum</tt> returned from <tt>\ref vxRegisterUserStruct</tt>.
+ * \param [in] capacity     The maximal number of items that the array can hold. This value must be greater than zero.
+ *
+ * \returns An array reference <tt>\ref vx_array</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ *
+ * \ingroup group_array
+ */
+VX_API_ENTRY vx_array VX_API_CALL vxCreateArray(vx_context context, vx_enum item_type, vx_size capacity);
+
+/*!
+ * \brief Creates an opaque reference to a virtual Array with no direct user access.
+ *
+ * Virtual Arrays are useful when item type or capacity are unknown ahead of time
+ * and the Array is used as internal graph edge. Virtual arrays are scoped within the parent graph only.
+ *
+ * All of the following constructions are allowed.
+ * \code
+ * vx_context context = vxCreateContext();
+ * vx_graph graph = vxCreateGraph(context);
+ * vx_array virt[] = {
+ *     vxCreateVirtualArray(graph, 0, 0), // totally unspecified
+ *     vxCreateVirtualArray(graph, VX_TYPE_KEYPOINT, 0), // unspecified capacity
+ *     vxCreateVirtualArray(graph, VX_TYPE_KEYPOINT, 1000), // no access
+ * };
+ * \endcode
+ *
+ * \param [in] graph        The reference to the parent graph.
+ * \param [in] item_type The type of data to hold. Must be greater than
+ * <tt>\ref VX_TYPE_INVALID</tt> and less than or equal to <tt>\ref VX_TYPE_VENDOR_STRUCT_END</tt>.
+ * Or must be a <tt>\ref vx_enum</tt> returned from <tt>\ref vxRegisterUserStruct</tt>.
+ *                          This may to set to zero to indicate an unspecified item type.
+ * \param [in] capacity     The maximal number of items that the array can hold.
+ *                          This may be to set to zero to indicate an unspecified capacity.
+ * \see vxCreateArray for a type list.
+ * \returns A array reference <tt>\ref vx_array</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ *
+ * \ingroup group_array
+ */
+VX_API_ENTRY vx_array VX_API_CALL vxCreateVirtualArray(vx_graph graph, vx_enum item_type, vx_size capacity);
+
+/*!
+ * \brief Releases a reference of an Array object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * After returning from this function the reference is zeroed.
+ * \param [in] arr          The pointer to the Array to release.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE arr is not a valid <tt>\ref vx_array</tt> reference.
+ * \ingroup group_array
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseArray(vx_array *arr);
+
+/*!
+ * \brief Queries the Array for some specific information.
+ *
+ * \param [in] arr          The reference to the Array.
+ * \param [in] attribute    The attribute to query. Use a <tt>\ref vx_array_attribute_e</tt>.
+ * \param [out] ptr         The location at which to store the resulting value.
+ * \param [in] size         The size in bytes of the container to which \a ptr points.
+ *
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS                   No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE   arr is not a valid <tt>\ref vx_array</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED       If the \a attribute is not a value supported on this implementation.
+ * \retval VX_ERROR_INVALID_PARAMETERS  If any of the other parameters are incorrect.
+ *
+ * \ingroup group_array
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryArray(vx_array arr, vx_enum attribute, void *ptr, vx_size size);
+
+/*!
+ * \brief Adds items to the Array.
+ *
+ * This function increases the container size.
+ *
+ * By default, the function does not reallocate memory,
+ * so if the container is already full (number of elements is equal to capacity)
+ * or it doesn't have enough space,
+ * the function returns <tt>\ref VX_FAILURE</tt> error code.
+ *
+ * \param [in] arr          The reference to the Array.
+ * \param [in] count        The total number of elements to insert.
+ * \param [in] ptr          The location from which to read the input values.
+ * \param [in] stride       The number of bytes between the beginning of two consecutive elements.
+ *
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS                   No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE   arr is not a valid <tt>\ref vx_array</tt> reference.
+ * \retval VX_FAILURE                   If the Array is full.
+ * \retval VX_ERROR_INVALID_PARAMETERS  If any of the other parameters are incorrect.
+ *
+ * \ingroup group_array
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxAddArrayItems(vx_array arr, vx_size count, const void *ptr, vx_size stride);
+
+/*!
+ * \brief Truncates an Array (remove items from the end).
+ *
+ * \param [in,out] arr          The reference to the Array.
+ * \param [in] new_num_items    The new number of items for the Array.
+ *
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS                   No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE   arr is not a valid <tt>\ref vx_array</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS  The \a new_size is greater than the current size.
+ *
+ * \ingroup group_array
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxTruncateArray(vx_array arr, vx_size new_num_items);
+
+/*! \brief Allows the application to copy a range from/into an array object.
+ * \param [in] array The reference to the array object that is the source or the
+ * destination of the copy.
+ * \param [in] range_start The index of the first item of the array object to copy.
+ * \param [in] range_end The index of the item following the last item of the
+ * array object to copy. (range_end range_start) items are copied from index
+ * range_start included. The range must be within the bounds of the array:
+ * 0 <= range_start < range_end <= number of items in the array.
+ * \param [in] user_stride The number of bytes between the beginning of two consecutive
+ * items in the user memory pointed by user_ptr. The layout of the user memory must
+ * follow an item major order:
+ * user_stride >= element size in bytes.
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the array
+ * object if the copy was requested in write mode. The accessible memory must be large enough
+ * to contain the specified range with the specified stride:
+ * accessible memory in bytes >= (range_end range_start) * user_stride.
+ * \param [in] usage This declares the effect of the copy with regard to the array object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt>
+ * are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data are copied from the array object into the user memory.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data are copied into the array object from the user memory.
+ * \param [in] user_mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_OPTIMIZED_AWAY This is a reference to a virtual array that cannot be
+ * accessed by the application.
+ * \retval VX_ERROR_INVALID_REFERENCE array is not a valid <tt>\ref vx_array</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_array
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyArrayRange(vx_array array, vx_size range_start, vx_size range_end, vx_size user_stride, void *user_ptr, vx_enum usage, vx_enum user_mem_type);
+
+/*! \brief Allows the application to get direct access to a range of an array object.
+ * \param [in] array The reference to the array object that contains the range to map.
+ * \param [in] range_start The index of the first item of the array object to map.
+ * \param [in] range_end The index of the item following the last item of the
+ * array object to map. (range_end range_start) items are mapped, starting from index
+ * range_start included. The range must be within the bounds of the array:
+ * Must be 0 <= range_start < range_end <= number of items.
+ * \param [out] map_id The address of a <tt>\ref vx_map_id</tt> variable where the function
+ * returns a map identifier.
+ * \arg (*map_id) must eventually be provided as the map_id parameter of a call to
+ * <tt>\ref vxUnmapArrayRange</tt>.
+ * \param [out] stride The address of a vx_size variable where the function
+ * returns the memory layout of the mapped array range. The function sets (*stride)
+ * to the number of bytes between the beginning of two consecutive items.
+ * The application must consult (*stride) to access the array items starting from
+ * address (*ptr). The layout of the mapped array follows an item major order:
+ * (*stride) >= item size in bytes.
+ * \param [out] ptr The address of a pointer that the function sets to the
+ * address where the requested data can be accessed. The returned (*ptr) address
+ * is only valid between the call to the function and the corresponding call to
+ * <tt>\ref vxUnmapArrayRange</tt>.
+ * \param [in] usage This declares the access mode for the array range, using
+ * the <tt>\ref vx_accessor_e</tt> enumeration.
+ * \arg <tt>\ref VX_READ_ONLY</tt>: after the function call, the content of the memory location
+ * pointed by (*ptr) contains the array range data. Writing into this memory location
+ * is forbidden and its behavior is undefined.
+ * \arg <tt>\ref VX_READ_AND_WRITE</tt>: after the function call, the content of the memory
+ * location pointed by (*ptr) contains the array range data; writing into this memory
+ * is allowed only for the location of items and will result in a modification of the
+ * affected items in the array object once the range is unmapped. Writing into
+ * a gap between items (when (*stride) > item size in bytes) is forbidden and its
+ * behavior is undefined.
+ * \arg <tt>\ref VX_WRITE_ONLY</tt>: after the function call, the memory location pointed by (*ptr)
+ * contains undefined data; writing each item of the range is required prior to
+ * unmapping. Items not written by the application before unmap will become
+ * undefined after unmap, even if they were well defined before map. Like for
+ * VX_READ_AND_WRITE, writing into a gap between items is forbidden and its behavior
+ * is undefined.
+ * \param [in] mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory where the array range is requested to be mapped.
+ * \param [in] flags An integer that allows passing options to the map operation.
+ * Use the <tt>\ref vx_map_flag_e</tt> enumeration.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_OPTIMIZED_AWAY This is a reference to a virtual array that cannot be
+ * accessed by the application.
+ * \retval VX_ERROR_INVALID_REFERENCE array is not a valid <tt>\ref vx_array</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_array
+ * \post <tt>\ref vxUnmapArrayRange </tt> with same (*map_id) value.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxMapArrayRange(vx_array array, vx_size range_start, vx_size range_end, vx_map_id *map_id, vx_size *stride, void **ptr, vx_enum usage, vx_enum mem_type, vx_uint32 flags);
+
+/*! \brief Unmap and commit potential changes to an array object range that was previously mapped.
+ * Unmapping an array range invalidates the memory location from which the range could
+ * be accessed by the application. Accessing this memory location after the unmap function
+ * completes has an undefined behavior.
+ * \param [in] array The reference to the array object to unmap.
+ * \param [out] map_id The unique map identifier that was returned when calling
+ * <tt>\ref vxMapArrayRange</tt> .
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE array is not a valid <tt>\ref vx_array</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_array
+ * \pre <tt>\ref vxMapArrayRange</tt> returning the same map_id value
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxUnmapArrayRange(vx_array array, vx_map_id map_id);
+
+/*!
+ * \brief Accesses a specific indexed element in an array.
+ * \param [in] ptr The base pointer for the array range.
+ * \param [in] index The index of the element, not byte, to access.
+ * \param [in] stride The 'number of bytes' between the beginning of two consecutive elements.
+ * \ingroup group_array
+ */
+#define vxFormatArrayPointer(ptr, index, stride) \
+    (&(((vx_uint8*)(ptr))[(index) * (stride)]))
+
+/*!
+ * \brief Allows access to an array item as a typecast pointer deference.
+ * \param [in] type The type of the item to access.
+ * \param [in] ptr The base pointer for the array range.
+ * \param [in] index The index of the element, not byte, to access.
+ * \param [in] stride The 'number of bytes' between the beginning of two consecutive elements.
+ * \ingroup group_array
+ */
+#define vxArrayItem(type, ptr, index, stride) \
+    (*(type *)(vxFormatArrayPointer((ptr), (index), (stride))))
+
+
+/*==============================================================================
+ OBJECT ARRAY
+ =============================================================================*/
+/*!
+ * \brief Creates a reference to an ObjectArray of count objects.
+ *
+ * It uses the metadata of the exemplar to determine the object attributes,
+ * ignoring the object data. It does not alter the exemplar or keep or release
+ * the reference to the exemplar. For the definition of supported attributes see
+ * <tt>\ref vxSetMetaFormatAttribute</tt>. In case the exemplar is a virtual object
+ * it must be of immutable metadata, thus it is not allowed to be dimensionless or formatless.
+ *
+ * \param [in] context      The reference to the overall Context.
+ * \param [in] exemplar     The exemplar object that defines the metadata of the created objects in the ObjectArray.
+ * \param [in] count        Number of Objects to create in the ObjectArray. This value must be greater than zero.
+ *
+ * \returns An ObjectArray reference <tt>\ref vx_object_array</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>. Data objects are not initialized by this function.
+ *
+ * \ingroup group_object_array
+ */
+VX_API_ENTRY vx_object_array VX_API_CALL vxCreateObjectArray(vx_context context, vx_reference exemplar, vx_size count);
+
+/*!
+ * \brief Creates an opaque reference to a virtual ObjectArray with no direct user access.
+ *
+ * This function creates an ObjectArray of count objects with similar behavior as
+ * <tt>\ref vxCreateObjectArray</tt>. The only difference is that the objects that are
+ * created are virtual in the given graph.
+ *
+ * \param [in] graph      Reference to the graph where to create the virtual ObjectArray.
+ * \param [in] exemplar   The exemplar object that defines the type of object in the ObjectArray.
+ *                        Only exemplar type of <tt>\ref vx_image</tt>, <tt>\ref vx_array</tt> and
+ *                        <tt>\ref vx_pyramid</tt> are allowed.
+ * \param [in] count      Number of Objects to create in the ObjectArray.
+ * \returns               A ObjectArray reference <tt>\ref vx_object_array</tt>. Any possible errors preventing a
+ *                        successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_object_array
+ */
+VX_API_ENTRY vx_object_array VX_API_CALL vxCreateVirtualObjectArray(vx_graph graph, vx_reference exemplar, vx_size count);
+
+/*!
+ * \brief                 Retrieves the reference to the OpenVX Object in location index of the ObjectArray.
+ *
+ * This is a vx_reference, which can be used elsewhere in OpenVX. A call to vxRelease<Object> or <tt>\ref vxReleaseReference</tt>
+ * is necessary to release the Object for each call to this function.
+ *
+ * \param [in] arr       The ObjectArray.
+ * \param [in] index     The index of the object in the ObjectArray.
+ * \return A reference to an OpenVX data object. Any possible errors preventing a successful
+ * completion of the function should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_object_array
+ */
+VX_API_ENTRY vx_reference VX_API_CALL vxGetObjectArrayItem(vx_object_array arr, vx_uint32 index);
+
+/*!
+ * \brief Releases a reference of an ObjectArray object.
+ *
+ * The object may not be garbage collected until its total reference and its contained objects
+ * count is zero. After returning from this function the reference is zeroed/cleared.
+ *
+ * \param [in] arr          The pointer to the ObjectArray to release.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE arr is not a valid <tt>\ref vx_object_array</tt> reference.
+ * \ingroup group_object_array
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseObjectArray(vx_object_array *arr);
+
+/*!
+ * \brief Queries an atribute from the ObjectArray.
+ *
+ * \param [in] arr          The reference to the ObjectArray.
+ * \param [in] attribute    The attribute to query. Use a <tt>\ref vx_object_array_attribute_e</tt>.
+ * \param [out] ptr         The location at which to store the resulting value.
+ * \param [in] size         The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS                   No errors; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE   arr is not a valid <tt>\ref vx_object_array</tt> reference.
+ * \retval VX_ERROR_NOT_SUPPORTED       If the \a attribute is not a value supported on this implementation.
+ * \retval VX_ERROR_INVALID_PARAMETERS  If any of the other parameters are incorrect.
+ *
+ * \ingroup group_object_array
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryObjectArray(vx_object_array arr, vx_enum attribute, void *ptr, vx_size size);
+
+
+/*==============================================================================
+ META FORMAT
+ =============================================================================*/
+
+/*! \brief This function allows a user to set the attributes of a <tt>\ref vx_meta_format</tt> object in a kernel output validator.
+ *
+ * The \ref vx_meta_format object contains two types of information: data object meta data and
+ * some specific information that defines how the valid region of an image changes
+ *
+ * The meta data attributes that can be set are identified by this list:
+ * - \ref vx_image : \ref VX_IMAGE_FORMAT, \ref VX_IMAGE_HEIGHT, \ref VX_IMAGE_WIDTH
+ * - \ref vx_array : \ref VX_ARRAY_CAPACITY, \ref VX_ARRAY_ITEMTYPE
+ * - \ref vx_pyramid : \ref VX_PYRAMID_FORMAT, \ref VX_PYRAMID_HEIGHT, \ref VX_PYRAMID_WIDTH, \ref VX_PYRAMID_LEVELS, \ref VX_PYRAMID_SCALE
+ * - \ref vx_scalar : \ref VX_SCALAR_TYPE
+ * - \ref vx_matrix : \ref VX_MATRIX_TYPE, \ref VX_MATRIX_ROWS, \ref VX_MATRIX_COLUMNS
+ * - \ref vx_distribution : \ref VX_DISTRIBUTION_BINS, \ref VX_DISTRIBUTION_OFFSET, \ref VX_DISTRIBUTION_RANGE
+ * - \ref vx_remap : \ref VX_REMAP_SOURCE_WIDTH, \ref VX_REMAP_SOURCE_HEIGHT, \ref VX_REMAP_DESTINATION_WIDTH, \ref VX_REMAP_DESTINATION_HEIGHT
+ * - \ref vx_lut : \ref VX_LUT_TYPE, \ref VX_LUT_COUNT
+ * - \ref vx_threshold : \ref VX_THRESHOLD_TYPE, \ref VX_THRESHOLD_INPUT_FORMAT, \ref VX_THRESHOLD_INPUT_FORMAT
+ * - \ref vx_object_array : \ref VX_OBJECT_ARRAY_NUMITEMS, \ref VX_OBJECT_ARRAY_ITEMTYPE
+ * - \ref vx_tensor : \ref VX_TENSOR_NUMBER_OF_DIMS, \ref VX_TENSOR_DIMS, \ref VX_TENSOR_DATA_TYPE, \ref VX_TENSOR_FIXED_POINT_POSITION
+ * - \ref VX_VALID_RECT_CALLBACK
+ * \note For vx_image, a specific attribute can be used to specify the valid region evolution. This information is not a meta data.
+ *
+ * \param [in] meta The reference to the \ref vx_meta_format struct to set
+ * \param [in] attribute Use the subset of data object attributes that define the meta data of this object or attributes from <tt>\ref vx_meta_format</tt>.
+ * \param [in] ptr The input pointer of the value to set on the meta format object.
+ * \param [in] size The size in bytes of the object to which \a ptr points.
+ * \ingroup group_user_kernels
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS The attribute was set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE meta is not a valid <tt>\ref vx_meta_format</tt> reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS size was not correct for the type needed.
+ * \retval VX_ERROR_NOT_SUPPORTED the object attribute was not supported on the meta format object.
+ * \retval VX_ERROR_INVALID_TYPE attribute type did not match known meta format type.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetMetaFormatAttribute(vx_meta_format meta, vx_enum attribute, const void *ptr, vx_size size);
+
+/*! \brief Set a meta format object from an exemplar data object reference
+ *
+ * This function sets a \ref vx_meta_format object from the meta data of the exemplar
+ *
+ * \param [in] meta The meta format object to set
+ * \param [in] exemplar The exemplar data object.
+ * \ingroup group_user_kernels
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS The meta format was correctly set; any other value indicates failure.
+ * \retval VX_ERROR_INVALID_REFERENCE meta is not a valid <tt>\ref vx_meta_format</tt> reference,
+ * or exemplar is not a valid <tt>\ref vx_reference</tt> reference.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxSetMetaFormatFromReference(vx_meta_format meta, vx_reference exemplar);
+/*==============================================================================
+    TENSOR DATA FUNCTIONS
+=============================================================================*/
+/*! \brief Creates an opaque reference to a tensor data buffer.
+ * \details Not guaranteed to exist until the <tt>\ref vx_graph</tt> containing it has been verified.
+ * Since functions using tensors, need to understand the context of each dimension. We describe a layout of the dimensions in each function using tensors.
+ * That layout is not mandatory. It is done specifically to explain the functions and not to mandate layout. Different implementation may have different layout.
+ * Therefore the layout description is logical and not physical. It refers to the order of dimensions given in this function.
+ * \param [in] context The reference to the implementation context.
+ * \param [in] number_of_dims The number of dimensions.
+ * \param [in] dims Dimensions sizes in elements.
+ * \param [in] data_type The <tt>\ref vx_type_e</tt> that represents the data type of the tensor data elements.
+ * \param [in] fixed_point_position Specifies the fixed point position when the input element type is integer. if 0, calculations are performed in integer math.
+ * \return A tensor data reference. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_tensor VX_API_CALL vxCreateTensor(vx_context context, vx_size number_of_dims, const vx_size * dims, vx_enum data_type,vx_int8 fixed_point_position);
+
+/*! \brief Creates an array of images into the multi-dimension data, this can be adjacent 2D images or not depending on the stride value.
+ * The stride value is representing bytes in the third dimension.
+ * The OpenVX image object that points to a three dimension data and access it as an array of images.
+ * This has to be portion of the third lowest dimension, and the stride correspond to that third dimension.
+ * The returned Object array is an array of images. Where the image data is pointing to a specific memory in the input tensor.
+ * \param [in] tensor The tensor data from which to extract the images. Has to be a 3d tensor.
+ * \param [in] rect Image coordinates within tensor data.
+ * \param [in] array_size Number of images to extract.
+ * \param [in] jump Delta between two images in the array.
+ * \param [in] image_format The requested image format. Should match the tensor data's data type.
+ * \return An array of images pointing to the tensor data's data.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_object_array VX_API_CALL vxCreateImageObjectArrayFromTensor(vx_tensor tensor, const vx_rectangle_t *rect, vx_size array_size, vx_size jump, vx_df_image image_format);
+
+/*! \brief Creates a tensor data from another tensor data given a view. This second
+ * reference refers to the data in the original tensor data. Updates to this tensor data
+ * updates the parent tensor data. The view must be defined within the dimensions
+ * of the parent tensor data.
+ * \param [in] tensor The reference to the parent tensor data.
+ * \param [in] number_of_dims Number of dimensions in the view. Error return if 0 or greater than number of
+ * tensor dimensions. If smaller than number of tensor dimensions, the lower dimensions are assumed.
+ * \param [in] view_start View start coordinates
+ * \param [in] view_end View end coordinates
+ * \return The reference to the sub-tensor. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_tensor VX_API_CALL vxCreateTensorFromView(vx_tensor tensor, vx_size number_of_dims, const vx_size * view_start, const vx_size * view_end);
+
+/*! \brief Creates an opaque reference to a tensor data buffer with no direct
+ * user access. This function allows setting the tensor data dimensions or data format.
+ * \details Virtual data objects allow users to connect various nodes within a
+ * graph via data references without access to that data, but they also permit the
+ * implementation to take maximum advantage of possible optimizations. Use this
+ * API to create a data reference to link two or more nodes together when the
+ * intermediate data are not required to be accessed by outside entities. This API
+ * in particular allows the user to define the tensor data format of the data without
+ * requiring the exact dimensions. Virtual objects are scoped within the graph
+ * they are declared a part of, and can't be shared outside of this scope.
+ * Since functions using tensors, need to understand the context of each dimension. We describe a layout of the dimensions in each function.
+ * That layout is not mandated. It is done specifically to explain the functions and not to mandate layout. Different implementation may have different layout.
+ * Therfore the layout description is logical and not physical. It refers to the order of dimensions given in <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * \param [in] graph The reference to the parent graph.
+ * \param [in] number_of_dims The number of dimensions.
+ * \param [in] dims Dimensions sizes in elements.
+ * \param [in] data_type The <tt>\ref vx_type_e</tt> that represents the data type of the tensor data elements.
+ * \param [in] fixed_point_position Specifies the fixed point position when the input element type is integer. If 0, calculations are performed in integer math.
+ * \return A tensor data reference.Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \note Passing this reference to <tt>\ref vxCopyTensorPatch</tt> will return an error.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_tensor VX_API_CALL vxCreateVirtualTensor(vx_graph graph, vx_size number_of_dims, const vx_size *dims, vx_enum data_type, vx_int8 fixed_point_position);
+
+
+/*! \brief Allows the application to copy a view patch from/into an tensor object .
+ * \param [in] tensor The reference to the tensor object that is the source or the
+ * destination of the copy.
+ * \param [in] number_of_dims Number of patch dimension. Error return if 0 or greater than number of
+ * tensor dimensions. If smaller than number of tensor dimensions, the lower dimensions are assumed.
+ * \param [in] view_start Array of patch start points in each dimension
+ * \param [in] view_end Array of patch end points in each dimension
+ * \param [in] user_stride Array of user memory strides in each dimension
+ * \param [in] user_ptr The address of the memory location where to store the requested data
+ * if the copy was requested in read mode, or from where to get the data to store into the tensor
+ * object if the copy was requested in write mode. The accessible memory must be large enough
+ * to contain the specified patch with the specified layout:\n
+ * accessible memory in bytes >= (end[last_dimension] - start[last_dimension]) * stride[last_dimension].\n
+ * The layout of the user memory must follow a row major order.
+ * \param [in] usage This declares the effect of the copy with regard to the tensor object
+ * using the <tt>\ref vx_accessor_e</tt> enumeration. Only <tt>\ref VX_READ_ONLY</tt> and <tt>\ref VX_WRITE_ONLY</tt> are supported:
+ * \arg <tt>\ref VX_READ_ONLY</tt> means that data is copied from the tensor object into the application memory
+ * \arg <tt>\ref VX_WRITE_ONLY</tt> means that data is copied into the tensor object from the application memory
+ * \param [in] user_memory_type A <tt>\ref vx_memory_type_e</tt> enumeration that specifies
+ * the memory type of the memory referenced by the user_addr.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_ERROR_OPTIMIZED_AWAY This is a reference to a virtual tensor that cannot be
+ * accessed by the application.
+ * \retval VX_ERROR_INVALID_REFERENCE The tensor reference is not actually an tensor reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxCopyTensorPatch(vx_tensor tensor, vx_size number_of_dims, const vx_size * view_start, const vx_size * view_end,
+        const vx_size * user_stride, void * user_ptr, vx_enum usage, vx_enum user_memory_type);
+
+/*! \brief Retrieves various attributes of a tensor data.
+ * \param [in] tensor The reference to the tensor data to query.
+ * \param [in] attribute The attribute to query. Use a <tt>\ref vx_tensor_attribute_e</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_ERROR_INVALID_REFERENCE If data is not a <tt>\ref vx_tensor</tt>.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryTensor(vx_tensor tensor, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Releases a reference to a tensor data object.
+ * The object may not be garbage collected until its total reference count is zero.
+ * \param [in] tensor The pointer to the tensor data to release.
+ * \post After returning from this function the reference is zeroed.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors; all other values indicate failure
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ * \ingroup group_object_tensor
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseTensor(vx_tensor *tensor);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif

+ 238 - 0
include_bakbak/VX/vx_compatibility.h

@@ -0,0 +1,238 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef VX_1_0_1_NAMING_COMPATIBILITY
+#define VX_1_0_1_NAMING_COMPATIBILITY
+
+#define VX_TYPE_SCALAR_MAX         (VX_TYPE_BOOL + 1)
+
+#define vx_border_mode_e           vx_border_e
+#define vx_border_mode_policy_e    vx_border_policy_e
+#define _vx_border_mode_t          _vx_border_t
+#define vx_border_mode_t           vx_border_t
+
+#define VX_ENUM_BORDER_MODE         VX_ENUM_BORDER
+#define VX_BORDER_MODE_POLICY       VX_BORDER_POLICY
+#define VX_BORDER_MODE_UNDEFINED    VX_BORDER_UNDEFINED
+#define VX_BORDER_MODE_CONSTANT     VX_BORDER_CONSTANT
+#define VX_BORDER_MODE_REPLICATE    VX_BORDER_REPLICATE
+#define VX_BORDER_MODE_UNSUPPORTED_POLICY_DEFAULT_TO_UNDEFINED  VX_BORDER_POLICY_DEFAULT_TO_UNDEFINED
+#define VX_BORDER_MODE_UNSUPPORTED_POLICY_RETURN_ERROR          VX_BORDER_POLICY_RETURN_ERROR
+
+#define VX_REF_ATTRIBUTE_COUNT VX_REFERENCE_COUNT
+#define VX_REF_ATTRIBUTE_TYPE  VX_REFERENCE_TYPE
+#define VX_REF_ATTRIBUTE_NAME  VX_REFERENCE_NAME
+
+#define VX_CONTEXT_ATTRIBUTE_VENDOR_ID                          VX_CONTEXT_VENDOR_ID
+#define VX_CONTEXT_ATTRIBUTE_VERSION                            VX_CONTEXT_VERSION
+#define VX_CONTEXT_ATTRIBUTE_UNIQUE_KERNELS                     VX_CONTEXT_UNIQUE_KERNELS
+#define VX_CONTEXT_ATTRIBUTE_MODULES                            VX_CONTEXT_MODULES
+#define VX_CONTEXT_ATTRIBUTE_REFERENCES                         VX_CONTEXT_REFERENCES
+#define VX_CONTEXT_ATTRIBUTE_IMPLEMENTATION                     VX_CONTEXT_IMPLEMENTATION
+#define VX_CONTEXT_ATTRIBUTE_EXTENSIONS_SIZE                    VX_CONTEXT_EXTENSIONS_SIZE
+#define VX_CONTEXT_ATTRIBUTE_EXTENSIONS                         VX_CONTEXT_EXTENSIONS
+#define VX_CONTEXT_ATTRIBUTE_CONVOLUTION_MAXIMUM_DIMENSION      VX_CONTEXT_CONVOLUTION_MAX_DIMENSION
+#define VX_CONTEXT_ATTRIBUTE_OPTICAL_FLOW_WINDOW_MAXIMUM_DIMENSION      VX_CONTEXT_OPTICAL_FLOW_MAX_WINDOW_DIMENSION
+#define VX_CONTEXT_ATTRIBUTE_IMMEDIATE_BORDER_MODE                      VX_CONTEXT_IMMEDIATE_BORDER
+#define VX_CONTEXT_ATTRIBUTE_UNIQUE_KERNEL_TABLE                        VX_CONTEXT_UNIQUE_KERNEL_TABLE
+
+#define VX_KERNEL_ATTRIBUTE_PARAMETERS      VX_KERNEL_PARAMETERS
+#define VX_KERNEL_ATTRIBUTE_NAME            VX_KERNEL_NAME
+#define VX_KERNEL_ATTRIBUTE_ENUM            VX_KERNEL_ENUM
+#define VX_KERNEL_ATTRIBUTE_LOCAL_DATA_SIZE VX_KERNEL_LOCAL_DATA_SIZE
+#define VX_KERNEL_ATTRIBUTE_LOCAL_DATA_PTR  (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x4)
+#define VX_KERNEL_ATTRIBUTE_GLOBAL_DATA_SIZE VX_KERNEL_GLOBAL_DATA_SIZE
+#define VX_KERNEL_ATTRIBUTE_GLOBAL_DATA_PTR  (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x7)
+
+#define VX_NODE_ATTRIBUTE_STATUS            VX_NODE_STATUS
+#define VX_NODE_ATTRIBUTE_PERFORMANCE       VX_NODE_PERFORMANCE
+#define VX_NODE_ATTRIBUTE_BORDER_MODE       VX_NODE_BORDER
+#define VX_NODE_ATTRIBUTE_LOCAL_DATA_SIZE   VX_NODE_LOCAL_DATA_SIZE
+#define VX_NODE_ATTRIBUTE_LOCAL_DATA_PTR    VX_NODE_LOCAL_DATA_PTR
+
+#define VX_PARAMETER_ATTRIBUTE_INDEX        VX_PARAMETER_INDEX
+#define VX_PARAMETER_ATTRIBUTE_DIRECTION    VX_PARAMETER_DIRECTION
+#define VX_PARAMETER_ATTRIBUTE_TYPE         VX_PARAMETER_TYPE
+#define VX_PARAMETER_ATTRIBUTE_STATE        VX_PARAMETER_STATE
+#define VX_PARAMETER_ATTRIBUTE_REF          VX_PARAMETER_REF
+
+#define VX_IMAGE_ATTRIBUTE_WIDTH            VX_IMAGE_WIDTH
+#define VX_IMAGE_ATTRIBUTE_HEIGHT           VX_IMAGE_HEIGHT
+#define VX_IMAGE_ATTRIBUTE_FORMAT           VX_IMAGE_FORMAT
+#define VX_IMAGE_ATTRIBUTE_PLANES           VX_IMAGE_PLANES
+#define VX_IMAGE_ATTRIBUTE_SPACE            VX_IMAGE_SPACE
+#define VX_IMAGE_ATTRIBUTE_RANGE            VX_IMAGE_RANGE
+#define VX_IMAGE_ATTRIBUTE_SIZE             VX_IMAGE_SIZE
+
+#define VX_SCALAR_ATTRIBUTE_TYPE            VX_SCALAR_TYPE
+
+#define VX_GRAPH_ATTRIBUTE_NUMNODES         VX_GRAPH_NUMNODES
+#define VX_GRAPH_ATTRIBUTE_STATUS           (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x1)
+#define VX_GRAPH_ATTRIBUTE_PERFORMANCE      VX_GRAPH_PERFORMANCE
+#define VX_GRAPH_ATTRIBUTE_NUMPARAMETERS    VX_GRAPH_NUMPARAMETERS
+
+#define VX_LUT_ATTRIBUTE_TYPE               VX_LUT_TYPE
+#define VX_LUT_ATTRIBUTE_COUNT              VX_LUT_COUNT
+#define VX_LUT_ATTRIBUTE_SIZE               VX_LUT_SIZE
+
+#define VX_DISTRIBUTION_ATTRIBUTE_DIMENSIONS    VX_DISTRIBUTION_DIMENSIONS
+#define VX_DISTRIBUTION_ATTRIBUTE_OFFSET        VX_DISTRIBUTION_OFFSET
+#define VX_DISTRIBUTION_ATTRIBUTE_RANGE         VX_DISTRIBUTION_RANGE
+#define VX_DISTRIBUTION_ATTRIBUTE_BINS          VX_DISTRIBUTION_BINS
+#define VX_DISTRIBUTION_ATTRIBUTE_WINDOW        VX_DISTRIBUTION_WINDOW
+#define VX_DISTRIBUTION_ATTRIBUTE_SIZE          VX_DISTRIBUTION_SIZE
+
+#define VX_THRESHOLD_ATTRIBUTE_TYPE             VX_THRESHOLD_TYPE
+#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_VALUE  VX_THRESHOLD_THRESHOLD_VALUE
+#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_LOWER  VX_THRESHOLD_THRESHOLD_LOWER
+#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_UPPER  VX_THRESHOLD_THRESHOLD_UPPER
+#define VX_THRESHOLD_ATTRIBUTE_TRUE_VALUE       VX_THRESHOLD_TRUE_VALUE
+#define VX_THRESHOLD_ATTRIBUTE_FALSE_VALUE      VX_THRESHOLD_FALSE_VALUE
+#define VX_THRESHOLD_ATTRIBUTE_DATA_TYPE        VX_THRESHOLD_DATA_TYPE
+
+#define VX_MATRIX_ATTRIBUTE_TYPE            VX_MATRIX_TYPE
+#define VX_MATRIX_ATTRIBUTE_ROWS            VX_MATRIX_ROWS
+#define VX_MATRIX_ATTRIBUTE_COLUMNS         VX_MATRIX_COLUMNS
+#define VX_MATRIX_ATTRIBUTE_SIZE            VX_MATRIX_SIZE
+
+#define VX_CONVOLUTION_ATTRIBUTE_ROWS       VX_CONVOLUTION_ROWS
+#define VX_CONVOLUTION_ATTRIBUTE_COLUMNS    VX_CONVOLUTION_COLUMNS
+#define VX_CONVOLUTION_ATTRIBUTE_SCALE      VX_CONVOLUTION_SCALE
+#define VX_CONVOLUTION_ATTRIBUTE_SIZE       VX_CONVOLUTION_SIZE
+
+#define VX_PYRAMID_ATTRIBUTE_LEVELS         VX_PYRAMID_LEVELS
+#define VX_PYRAMID_ATTRIBUTE_SCALE          VX_PYRAMID_SCALE
+#define VX_PYRAMID_ATTRIBUTE_WIDTH          VX_PYRAMID_WIDTH
+#define VX_PYRAMID_ATTRIBUTE_HEIGHT         VX_PYRAMID_HEIGHT
+#define VX_PYRAMID_ATTRIBUTE_FORMAT         VX_PYRAMID_FORMAT
+
+#define VX_REMAP_ATTRIBUTE_SOURCE_WIDTH         VX_REMAP_SOURCE_WIDTH
+#define VX_REMAP_ATTRIBUTE_SOURCE_HEIGHT        VX_REMAP_SOURCE_HEIGHT
+#define VX_REMAP_ATTRIBUTE_DESTINATION_WIDTH    VX_REMAP_DESTINATION_WIDTH
+#define VX_REMAP_ATTRIBUTE_DESTINATION_HEIGHT   VX_REMAP_DESTINATION_HEIGHT
+
+#define VX_ARRAY_ATTRIBUTE_ITEMTYPE         VX_ARRAY_ITEMTYPE
+#define VX_ARRAY_ATTRIBUTE_NUMITEMS         VX_ARRAY_NUMITEMS
+#define VX_ARRAY_ATTRIBUTE_CAPACITY         VX_ARRAY_CAPACITY
+#define VX_ARRAY_ATTRIBUTE_ITEMSIZE         VX_ARRAY_ITEMSIZE
+
+#define VX_DELAY_ATTRIBUTE_TYPE             VX_DELAY_TYPE
+#define VX_DELAY_ATTRIBUTE_SLOTS            VX_DELAY_SLOTS
+
+#define VX_INTERPOLATION_TYPE_AREA                  VX_INTERPOLATION_AREA
+#define VX_INTERPOLATION_TYPE_BILINEAR              VX_INTERPOLATION_BILINEAR
+#define VX_INTERPOLATION_TYPE_NEAREST_NEIGHBOR      VX_INTERPOLATION_NEAREST_NEIGHBOR
+
+#define VX_IMAGE_SIZE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x6)
+
+#define VX_META_FORMAT_ATTRIBUTE_DELTA_RECTANGLE  (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_META_FORMAT) + 0x0)
+#define VX_HINT_SERIALIZE (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_HINT) + 0x0)
+
+#define vx_import_type_e        vx_memory_type_e
+#define VX_ENUM_IMPORT_MEM      VX_ENUM_MEMORY_TYPE
+#define VX_IMPORT_TYPE_NONE     VX_MEMORY_TYPE_NONE
+#define VX_IMPORT_TYPE_HOST     VX_MEMORY_TYPE_HOST
+
+#define VX_TYPE_OBJECT_MAX      VX_TYPE_KHRONOS_OBJECT_END
+#define VX_TYPE_STRUCT_MAX      VX_TYPE_KHRONOS_STRUCT_MAX
+
+#define VX_KERNEL_INVALID (VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x0)
+
+#define VX_THRESHOLD_THRESHOLD_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x1)
+#define VX_THRESHOLD_THRESHOLD_LOWER (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x2)
+#define VX_THRESHOLD_THRESHOLD_UPPER (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x3)
+#define VX_THRESHOLD_TRUE_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x4)
+#define VX_THRESHOLD_FALSE_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x5)
+#define VX_THRESHOLD_DATA_TYPE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x6)
+
+typedef vx_status(VX_CALLBACK *vx_kernel_input_validate_f)(vx_node node, vx_uint32 index);
+
+typedef vx_status(VX_CALLBACK *vx_kernel_output_validate_f)(vx_node node, vx_uint32 index, vx_meta_format meta);
+
+typedef struct _vx_delta_rectangle_t {
+    vx_int32 delta_start_x; /*!< \brief The change in the start x. */
+    vx_int32 delta_start_y; /*!< \brief The change in the start y. */
+    vx_int32 delta_end_x;   /*!< \brief The change in the end x. */
+    vx_int32 delta_end_y;   /*!< \brief The change in the end y. */
+} vx_delta_rectangle_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+VX_API_ENTRY vx_kernel VX_API_CALL vxAddKernel(vx_context context,
+                             const vx_char name[VX_MAX_KERNEL_NAME],
+                             vx_enum enumeration,
+                             vx_kernel_f func_ptr,
+                             vx_uint32 numParams,
+                             vx_kernel_input_validate_f input,
+                             vx_kernel_output_validate_f output,
+                             vx_kernel_initialize_f init,
+                             vx_kernel_deinitialize_f deinit);
+
+VX_API_ENTRY vx_size VX_API_CALL vxComputeImagePatchSize(vx_image image,
+                                       const vx_rectangle_t *rect,
+                                       vx_uint32 plane_index);
+
+VX_API_ENTRY vx_status VX_API_CALL vxAccessImagePatch(vx_image image,
+                                    const vx_rectangle_t *rect,
+                                    vx_uint32 plane_index,
+                                    vx_imagepatch_addressing_t *addr,
+                                    void **ptr,
+                                    vx_enum usage);
+
+VX_API_ENTRY vx_status VX_API_CALL vxCommitImagePatch(vx_image image,
+                                    const vx_rectangle_t *rect,
+                                    vx_uint32 plane_index,
+                                    const vx_imagepatch_addressing_t *addr,
+                                    const void *ptr);
+
+VX_API_ENTRY vx_status VX_API_CALL vxAccessArrayRange(vx_array arr, vx_size start, vx_size end, vx_size *stride, void **ptr, vx_enum usage);
+
+VX_API_ENTRY vx_status VX_API_CALL vxCommitArrayRange(vx_array arr, vx_size start, vx_size end, const void *ptr);
+
+VX_API_ENTRY vx_status VX_API_CALL vxAccessDistribution(vx_distribution distribution, void **ptr, vx_enum usage);
+
+VX_API_ENTRY vx_status VX_API_CALL vxCommitDistribution(vx_distribution distribution, const void * ptr);
+
+VX_API_ENTRY vx_status VX_API_CALL vxAccessLUT(vx_lut lut, void **ptr, vx_enum usage);
+
+VX_API_ENTRY vx_status VX_API_CALL vxCommitLUT(vx_lut lut, const void *ptr);
+
+VX_API_ENTRY vx_status VX_API_CALL vxReadMatrix(vx_matrix mat, void *array);
+
+VX_API_ENTRY vx_status VX_API_CALL vxWriteMatrix(vx_matrix mat, const void *array);
+
+VX_API_ENTRY vx_status VX_API_CALL vxReadConvolutionCoefficients(vx_convolution conv, vx_int16 *array);
+
+VX_API_ENTRY vx_status VX_API_CALL vxWriteConvolutionCoefficients(vx_convolution conv, const vx_int16 *array);
+
+VX_API_ENTRY vx_status VX_API_CALL vxReadScalarValue(vx_scalar ref, void *ptr);
+
+VX_API_ENTRY vx_status VX_API_CALL vxWriteScalarValue(vx_scalar ref, const void *ptr);
+
+VX_API_ENTRY vx_status VX_API_CALL vxSetRemapPoint(vx_remap table, vx_uint32 dst_x, vx_uint32 dst_y, vx_float32 src_x,vx_float32 src_y);
+
+VX_API_ENTRY vx_status VX_API_CALL vxGetRemapPoint(vx_remap table, vx_uint32 dst_x, vx_uint32 dst_y, vx_float32 *src_x, vx_float32 *src_y);
+
+VX_API_ENTRY vx_threshold VX_API_CALL vxCreateThreshold(vx_context c, vx_enum thresh_type, vx_enum data_type);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* VX_1_0_1_NAMING_COMPATIBILITY */

+ 183 - 0
include_bakbak/VX/vx_import.h

@@ -0,0 +1,183 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef _OPENVX_IMPORT_H_
+#define _OPENVX_IMPORT_H_
+/*!
+ * \file
+ * \brief The OpenVX Import API
+ * part of the OpenVX Export and Import extension API
+ * and also part of the OpenVX SC deployment feature set.
+ */
+
+ /*! \brief An enumeration of export uses. See <tt>\ref vxExportObjectsToMemory</tt> and
+ * <tt>\ref vxImportObjectsFromMemory</tt>
+ * \ingroup vx_enum_e
+ */
+#define VX_ENUM_IX_USE      0x18
+/*! \brief How to export and import an object
+ * \ingroup group_import
+ */
+#define VX_IX_USE_APPLICATION_CREATE (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_IX_USE) + 0x0) /*!< \brief The application will create the object before import. */
+/*! \brief How to export and import an object
+ * \ingroup group_import
+ */
+#define VX_IX_USE_EXPORT_VALUES (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_IX_USE) + 0x1) /*!< \brief Data values are exported and restored upon import. */
+/*! \brief How to export and import an object
+ * \ingroup group_import
+ */
+#define VX_IX_USE_NO_EXPORT_VALUES (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_IX_USE) + 0x2) /*!< \brief Data values are not exported. */
+
+/*=============================================================================
+IMPORT
+=============================================================================*/
+/*! \brief The Import Object. Import is a container of OpenVX objects, which may be retreived
+ * by name
+ * \ingroup group_import
+ */
+typedef struct _vx_import *vx_import;
+
+/*! \brief The Object Type Enumeration for import.
+ * \ingroup group_import
+ */
+
+#define VX_TYPE_IMPORT          0x814/*!< \brief A <tt>\ref vx_import</tt>. */
+
+/*! \brief Imports objects into a context from a vendor-specific format in memory.\n
+ *
+ * \details This function imports objects from a memory blob previously created using <tt>\ref vxExportObjectsToMemory</tt>[*REQ*].\n
+ * A pointer to memory is given where a list of references is stored, together with the list
+ * of uses which describes how the references are used. The number of references given and the
+ * list of uses must match that given upon export, or this function will not be sucessful[*REQ*].\n
+ * The *uses* array specifies how the objects in the corresponding *refs* array will be imported:
+ * - <tt>\ref VX_IX_USE_APPLICATION_CREATE</tt>\n
+ * The application must create the object and supply the reference; the
+ *  meta-data of the object must match exactly the meta-data of the object when it was exported,
+ *  except that the name need not match[*REQ*].\n
+ *  If the supplied reference has a different name to that stored, the supplied name is used[*REQ*].
+ * - <tt>\ref VX_IX_USE_EXPORT_VALUES</tt>\n
+ * The implementation will create the object and set the data in it[*REQ*].\n
+ * Any data not defined at the time of export of the object will be set to a default value (zero in the
+ * absence of any other definition) upon import[*REQ*].
+ * - <tt>\ref VX_IX_USE_NO_EXPORT_VALUES</tt>\n
+ * The implementation will create the object and the importing application will set values as applicable[*REQ*].
+ *
+ * References are obtained from the import API for those objects whose references were listed at the time of export.
+ * These are not the same objects; they are equivalent objects created by the framework at import time.
+ * The implementation guarantees that references will be available and valid for all objects listed at the time
+ * of export, or the import will fail[*REQ*].\n
+ * The import operation will fail if more than one object whose reference is listed at *refs*
+ * has been given the same non-zero length name (via <tt>\ref vxSetReferenceName</tt>)[*REQ*].\n
+ * The import will be unsuccessful if any of the parameters supplied is NULL[*REQ*].\n
+ * After completion of the function the memory at *ptr* may be deallocated by the application as it will
+ * not be used by any of the created objects[*REQ*].\n
+ * Any delays imported with graphs for which they are registered for auto-aging remain registered
+ * for auto-aging[*REQ*].\n
+ * After import, a graph must execute with exactly the same effect with respect to its visible parameters
+ * as before export[*REQ*].
+ * \note The *refs* array must be the correct length to hold all references of the import; this will be the same length
+ * that was supplied at the time of export. Only references for objects created by the application, where the
+ * corresponding *uses* entry is <tt>\ref VX_IX_USE_APPLICATION_CREATE</tt> should be filled in by the application;
+ * all other entries will be supplied by the framework and may be initialised by the application to NULL. The *uses* array
+ * must have the identical length and content as given at the time of export, and the value of *numrefs* must also match;
+ * these measures increase confidence that the import contains the correct data.
+* \note Graph parameters may be changed after import by using the <tt>\ref vxSetGraphParameterByIndex</tt> API, and
+ * images may also be changed by using the <tt>\ref vxSwapImageHandle</tt> API.
+ * When <tt>\ref vxSetGraphParameterByIndex</tt> is used, the framework will check that the new parameter is of the
+ * correct type to run with the graph, which cannot be re-verified. If the reference supplied is not suitable, an error
+ * will be returned, but there may be circumstances where changing graph parameters for unsuitable ones is not detected
+ * and could lead to implementation-dependent behaviour; one such circumstance is when the new parameters are images
+ * corresponding to overlapping regions of interest. The user should avoid these circumstances.
+ * In other words,
+ *  - The meta data of the new graph parameter must match the meta data of the graph parameter it replaces [*REQ*].
+ *  - A graph parameter must not be NULL [*REQ*].
+ * \param [in] context context into which to import objects, must be valid [*REQ*].
+ * \param [in] numrefs number of references to import, must match export[*REQ*].
+ * \param [in,out] refs references imported or application-created data which must match
+ * meta-data of the export[*REQ*]
+ * \param [in] uses how to import the references, must match export values[*REQ*]
+ * \param [in] ptr pointer to binary buffer containing a valid binary export[*REQ*]
+ * \param [in] length number of bytes at \*ptr, i.e. the length of the export[*REQ*]
+ * \return A <tt>\ref vx_import</tt>[*REQ*].
+ * Calling <tt>\ref vxGetStatus</tt> with the vx_import as a parameter will return VX_SUCCESS if the
+ * function was successful[*REQ*].\n
+ * Another value is given to indicate that there was an error[*REQ*].\n
+ * An implementation may provide several different error codes to give useful diagnostic information
+ * in the event of failure to import objects, but these are not required to indicate
+ * possibly recovery mechanisms, and for safety critical use assume errors are not recoverable.
+ * \post <tt>\ref vxReleaseImport</tt> is used to release the import object.
+ * \post Use <tt>\ref vxReleaseReference</tt> or an appropriate specific release function to release
+ * the references in the array refs when they are no longer required.
+ * \ingroup group_import
+ */
+VX_API_ENTRY vx_import VX_API_CALL vxImportObjectsFromMemory(
+    vx_context context,
+    vx_size numrefs,
+    vx_reference *refs,
+    const vx_enum * uses,
+    const vx_uint8 * ptr,
+    vx_size length);
+
+/*! \brief Releases an import object when no longer required.\n
+ * \details This function releases the reference to the import object [*REQ*].\n
+ * Other objects including those imported at the time of creation of the import object are unaffected[*REQ*].\n
+ * \param [in,out] import The pointer to the reference to the import object[*REQ*].
+ * \post After returning sucessfully from this function the reference is zeroed[*REQ*].
+ * \return A <tt>\ref vx_status</tt> value.
+ * \retval VX_SUCCESS If no errors occurred and the import was sucessfully released[*REQ*].\n
+ * An error is indicated when the return value is not VX_SUCCESS[*REQ*].\n
+ * An implementation may provide several different return values to give useful diagnostic
+ * information in the event of failure to export, but these are not required to indicate
+ * possibly recovery mechanisms, and for safety critical use assume errors are not recoverable.
+ * \pre <tt>\ref vxImportObjectsFromMemory</tt> is used to create an import object.
+ * \ingroup group_import
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseImport(vx_import *import);
+/*! \brief Get a reference from the import object by name.\n
+ *
+ * \details All accessible references of the import object created using <tt>\ref vxImportObjectsFromMemory</tt> are
+ * in the array *refs*, which is populated partly by the application before import, and partly by the
+ * framework. However, it may be more convenient to access the references in the import object without
+ * referring to this array, for example if the import object is passed as a parameter to another function.
+ * In this case, references may be retreived by name, assuming that <tt>\ref vxSetReferenceName</tt>
+ * was called to assign a name to the reference.
+ * This function searches the given import for the given name and returns the associated reference[*REQ*].\n
+ * The reference may have been named either before export or after import[*REQ*].\n
+ * If more than one reference exists in the import with the given name, this is an error[*REQ*].\n
+ * Only references in the array *refs* after calling <tt>\ref vxImportObjectsFromMemory</tt> may be retrieved
+ * using this function[*REQ*].\n
+ * A reference to a named object may be obtained from a valid import object using this API even if all other
+ * references to the object have been released[*REQ*].
+ * \param [in] import The import object in which to find the name; the function will fail if this parameter
+ * is not valid[*REQ*].
+ * \param [in] name The name to find, points to a string of at least one and less than VX_MAX_REFERENCE_NAME bytes
+ * followed by a zero byte; the function will fail if this is not valid[*REQ*].
+ * \return A <tt>\ref vx_reference</tt>[*REQ*].\n
+ * Calling <tt>\ref vxGetStatus</tt> with the reference as a parameter will return VX_SUCCESS if the function
+ * was successful[*REQ*].\n
+ * Another value is given to indicate that there was an error[*REQ*].\n
+ * On success, the reference count of the object in question is incremented[*REQ*].\n
+ * An implementation may provide several different error codes to give useful diagnostic information
+ * in the event of failure to retrieve a reference, but these are not required to indicate
+ * possibly recovery mechanisms, and for safety critical use assume errors are not recoverable.
+ * \pre <tt>\ref vxSetReferenceName</tt> was used to name the reference.
+ * \post use <tt>ref vxReleaseReference</tt> or appropriate specific release function to release a reference
+ * obtained by this method.
+ * \ingroup group_import
+ */
+VX_API_ENTRY vx_reference VX_API_CALL vxGetImportReferenceByName(vx_import import, const vx_char *name);
+
+#endif

+ 401 - 0
include_bakbak/VX/vx_kernels.h

@@ -0,0 +1,401 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_KERNELS_H_
+#define _OPENVX_KERNELS_H_
+
+/*!
+ * \file
+ * \brief The list of supported kernels in the OpenVX standard.
+ */
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/*!
+ * \brief The standard list of available libraries
+ * \ingroup group_kernel
+ */
+enum vx_library_e {
+    /*! \brief The base set of kernels as defined by Khronos. */
+    VX_LIBRARY_KHR_BASE = 0x0,
+};
+
+/*!
+ * \brief The standard list of available vision kernels.
+ *
+ * Each kernel listed here can be used with the <tt>\ref vxGetKernelByEnum</tt> call.
+ * When programming the parameters, use
+ * \arg <tt>\ref VX_INPUT</tt> for [in]
+ * \arg <tt>\ref VX_OUTPUT</tt> for [out]
+ * \arg <tt>\ref VX_BIDIRECTIONAL</tt> for [in,out]
+ *
+ * When programming the parameters, use
+ * \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.
+ * \ingroup group_kernel
+ */
+enum vx_kernel_e {
+
+    /*!
+     * \brief The Color Space conversion kernel.
+     * \details The conversions are based on the <tt>\ref vx_df_image_e</tt> code in the images.
+     * \see group_vision_function_colorconvert
+     */
+    VX_KERNEL_COLOR_CONVERT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1,
+
+    /*!
+     * \brief The Generic Channel Extraction Kernel.
+     * \details This kernel can remove individual color channels from an interleaved
+     * or semi-planar, planar, sub-sampled planar image. A client could extract
+     * a red channel from an interleaved RGB image or do a Luma extract from a
+     * YUV format.
+     * \see group_vision_function_channelextract
+     */
+    VX_KERNEL_CHANNEL_EXTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2,
+
+    /*!
+     * \brief The Generic Channel Combine Kernel.
+     * \details This kernel combine multiple individual planes into a single
+     * multiplanar image of the type specified in the output image.
+     * \see group_vision_function_channelcombine
+     */
+    VX_KERNEL_CHANNEL_COMBINE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3,
+
+    /*! \brief The Sobel 3x3 Filter Kernel.
+     * \see group_vision_function_sobel3x3
+     */
+    VX_KERNEL_SOBEL_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x4,
+
+    /*!
+     * \brief The Magnitude Kernel.
+     * \details This kernel produces a magnitude plane from two input gradients.
+     * \see group_vision_function_magnitude
+     */
+    VX_KERNEL_MAGNITUDE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x5,
+
+    /*!
+     * \brief The Phase Kernel.
+     * \details This kernel produces a phase plane from two input gradients.
+     * \see group_vision_function_phase
+     */
+    VX_KERNEL_PHASE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x6,
+
+    /*!
+     * \brief The Scale Image Kernel.
+     * \details This kernel provides resizing of an input image to an output image.
+     * The scaling factor is determined but the relative sizes of the input and
+     * output.
+     * \see group_vision_function_scale_image
+     */
+    VX_KERNEL_SCALE_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x7,
+
+    /*! \brief The Table Lookup kernel
+     * \see group_vision_function_lut
+     */
+    VX_KERNEL_TABLE_LOOKUP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x8,
+
+    /*! \brief The Histogram Kernel.
+     * \see group_vision_function_histogram
+     */
+    VX_KERNEL_HISTOGRAM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x9,
+
+    /*! \brief The Histogram Equalization Kernel.
+     * \see group_vision_function_equalize_hist
+     */
+    VX_KERNEL_EQUALIZE_HISTOGRAM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xA,
+
+    /*! \brief The Absolute Difference Kernel.
+     * \see group_vision_function_absdiff
+     */
+    VX_KERNEL_ABSDIFF = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xB,
+
+    /*! \brief The Mean and Standard Deviation Kernel.
+     * \see group_vision_function_meanstddev
+     */
+    VX_KERNEL_MEAN_STDDEV = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xC,
+
+    /*! \brief The Threshold Kernel.
+     * \see group_vision_function_threshold
+     */
+    VX_KERNEL_THRESHOLD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xD,
+
+    /*! \brief The Integral Image Kernel.
+     * \see group_vision_function_integral_image
+     */
+    VX_KERNEL_INTEGRAL_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xE,
+
+    /*! \brief The dilate kernel.
+     * \see group_vision_function_dilate_image
+     */
+    VX_KERNEL_DILATE_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xF,
+
+    /*! \brief The erode kernel.
+     * \see group_vision_function_erode_image
+     */
+    VX_KERNEL_ERODE_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x10,
+
+    /*! \brief The median image filter.
+     * \see group_vision_function_median_image
+     */
+    VX_KERNEL_MEDIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x11,
+
+    /*! \brief The box filter kernel.
+     * \see group_vision_function_box_image
+     */
+    VX_KERNEL_BOX_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x12,
+
+    /*! \brief The gaussian filter kernel.
+     * \see group_vision_function_gaussian_image
+     */
+    VX_KERNEL_GAUSSIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x13,
+
+    /*! \brief The custom convolution kernel.
+     * \see group_vision_function_custom_convolution
+     */
+    VX_KERNEL_CUSTOM_CONVOLUTION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x14,
+
+    /*! \brief The gaussian image pyramid kernel.
+     * \see group_vision_function_gaussian_pyramid
+     */
+    VX_KERNEL_GAUSSIAN_PYRAMID = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x15,
+
+    /*! \brief The accumulation kernel.
+     * \see group_vision_function_accumulate
+     */
+    VX_KERNEL_ACCUMULATE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x16,
+
+    /*! \brief The weigthed accumulation kernel.
+     * \see group_vision_function_accumulate_weighted
+     */
+    VX_KERNEL_ACCUMULATE_WEIGHTED = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x17,
+
+    /*! \brief The squared accumulation kernel.
+     * \see group_vision_function_accumulate_square
+     */
+    VX_KERNEL_ACCUMULATE_SQUARE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x18,
+
+    /*! \brief The min and max location kernel.
+     * \see group_vision_function_minmaxloc
+     */
+    VX_KERNEL_MINMAXLOC = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x19,
+
+    /*! \brief The bit-depth conversion kernel.
+     * \see group_vision_function_convertdepth
+     */
+    VX_KERNEL_CONVERTDEPTH = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1A,
+
+    /*! \brief The Canny Edge Detector.
+     * \see group_vision_function_canny
+     */
+    VX_KERNEL_CANNY_EDGE_DETECTOR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1B,
+
+    /*! \brief The Bitwise And Kernel.
+     * \see group_vision_function_and
+     */
+    VX_KERNEL_AND = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1C,
+
+    /*! \brief The Bitwise Inclusive Or Kernel.
+     * \see group_vision_function_or
+     */
+    VX_KERNEL_OR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1D,
+
+    /*! \brief The Bitwise Exclusive Or Kernel.
+     * \see group_vision_function_xor
+     */
+    VX_KERNEL_XOR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1E,
+
+    /*! \brief The Bitwise Not Kernel.
+     * \see group_vision_function_not
+     */
+    VX_KERNEL_NOT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1F,
+
+    /*! \brief The Pixelwise Multiplication Kernel.
+     * \see group_vision_function_mult
+     */
+    VX_KERNEL_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x20,
+
+    /*! \brief The Addition Kernel.
+     * \see group_vision_function_add
+     */
+    VX_KERNEL_ADD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x21,
+
+    /*! \brief The Subtraction Kernel.
+     * \see group_vision_function_sub
+     */
+    VX_KERNEL_SUBTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x22,
+
+    /*! \brief The Warp Affine Kernel.
+     * \see group_vision_function_warp_affine
+     */
+    VX_KERNEL_WARP_AFFINE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x23,
+
+    /*! \brief The Warp Perspective Kernel.
+     * \see group_vision_function_warp_perspective
+     */
+    VX_KERNEL_WARP_PERSPECTIVE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x24,
+
+    /*! \brief The Harris Corners Kernel.
+     * \see group_vision_function_harris
+     */
+    VX_KERNEL_HARRIS_CORNERS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x25,
+
+    /*! \brief The FAST Corners Kernel.
+     * \see group_vision_function_fast
+     */
+    VX_KERNEL_FAST_CORNERS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x26,
+
+    /*! \brief The Optical Flow Pyramid (LK) Kernel.
+     * \see group_vision_function_opticalflowpyrlk
+     */
+    VX_KERNEL_OPTICAL_FLOW_PYR_LK = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x27,
+
+    /*! \brief The Remap Kernel.
+     * \see group_vision_function_remap
+     */
+    VX_KERNEL_REMAP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x28,
+
+    /*! \brief The Half Scale Gaussian Kernel.
+     * \see group_vision_function_scale_image
+     */
+    VX_KERNEL_HALFSCALE_GAUSSIAN = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x29,
+
+    VX_KERNEL_MAX_1_0, /*!< \internal Used for VX1.0 bounds checking in the conformance test. */
+
+    /* kernel added in OpenVX 1.1 */
+
+    /*! \brief The Laplacian Image Pyramid Kernel.
+    * \see group_vision_function_laplacian_pyramid
+    */
+    VX_KERNEL_LAPLACIAN_PYRAMID = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2A,
+
+    /*! \brief The Laplacian Pyramid Reconstruct Kernel.
+    * \see group_vision_function_laplacian_pyramid
+    */
+    VX_KERNEL_LAPLACIAN_RECONSTRUCT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2B,
+
+    /*! \brief The Non Linear Filter Kernel.
+    * \see group_vision_function_nonlinear_filter
+    */
+    VX_KERNEL_NON_LINEAR_FILTER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2C,
+
+    VX_KERNEL_MAX_1_1, /*!< \internal Used for VX1.1 bounds checking in the conformance test. */
+
+    /* kernel added in OpenVX 1.2 */
+
+    /*! \brief The Match Template Kernel.
+    * \see group_vision_match_template
+    */
+    VX_KERNEL_MATCH_TEMPLATE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2D,
+
+    /*! \brief The LBP Kernel.
+    * \see group_lbp
+    */
+    VX_KERNEL_LBP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2E,
+
+    /*! \brief The hough lines probability Kernel.
+    * \see group_vision_hough_lines_p
+    */
+    VX_KERNEL_HOUGH_LINES_P = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2F,
+
+    /*! \brief The tensor multiply Kernel.
+    * \see group_vision_function_tensor_multiply
+    */
+    VX_KERNEL_TENSOR_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x30,
+
+    /*! \brief The tensor add Kernel.
+    * \see group_vision_function_tensor_add
+    */
+    VX_KERNEL_TENSOR_ADD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x31,
+
+    /*! \brief The tensor subtract Kernel.
+    * \see group_vision_function_tensor_subtract
+    */
+    VX_KERNEL_TENSOR_SUBTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x32,
+
+    /*! \brief The tensor table look up Kernel.
+    * \see group_vision_function_tensor_tablelookup
+    */
+    VX_KERNEL_TENSOR_TABLE_LOOKUP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x33,
+
+    /*! \brief The tensor transpose Kernel.
+    * \see group_vision_function_tensor_transpose
+    */
+    VX_KERNEL_TENSOR_TRANSPOSE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x34,
+
+    /*! \brief The tensor convert depth Kernel.
+    * \see group_vision_function_tensor_convert_depth
+    */
+    VX_KERNEL_TENSOR_CONVERT_DEPTH = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x35,
+
+    /*! \brief The tensor matrix multiply Kernel.
+    * \see group_vision_function_tensor_matrix_multiply
+    */
+    VX_KERNEL_TENSOR_MATRIX_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x36,
+
+    /*! \brief The data object copy kernel.
+    * \see group_vision_function_copy
+    */
+    VX_KERNEL_COPY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x37,
+
+    /*! \brief The non-max suppression kernel.
+    * \see group_vision_function_nms
+    */
+    VX_KERNEL_NON_MAX_SUPPRESSION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x38,
+
+    /*! \brief The scalar operation kernel.
+    * \see group_control_flow
+    */
+    VX_KERNEL_SCALAR_OPERATION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x39,
+
+    /*! \brief The  HOG features kernel.
+    * \see group_vision_function_hog
+    */
+    VX_KERNEL_HOG_FEATURES = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3A,
+
+    /*! \brief The HOG Cells kernel.
+    * \see group_vision_function_hog
+    */
+    VX_KERNEL_HOG_CELLS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3B,
+
+    /*! \brief The bilateral filter kernel.
+    * \see group_vision_function_bilateral_filter
+    */
+    VX_KERNEL_BILATERAL_FILTER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3C,
+
+    /*! \brief The select kernel.
+    * \see group_control_flow
+    */
+    VX_KERNEL_SELECT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3D,
+
+    /* insert new kernels here */
+    VX_KERNEL_MAX_1_2, /*!< \internal Used for VX1.2 bounds checking in the conformance test. */
+    /*! \brief The max kernel.
+    * \see group_vision_function_max
+    */
+    VX_KERNEL_MAX = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3E,
+    /*! \brief The min kernel.
+    * \see group_vision_function_min
+    */
+    VX_KERNEL_MIN = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3F,
+};
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif  /* _OPEN_VISION_LIBRARY_KERNELS_H_ */

+ 139 - 0
include_bakbak/VX/vx_khr_class.h

@@ -0,0 +1,139 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _VX_KHR_CLASSIFIER_H_
+#define _VX_KHR_CLASSIFIER_H_
+
+/*!
+ * \file
+ * \brief The Khronos Extension for general classification.
+ *
+ */
+
+#define OPENVX_KHR_CLASS   "vx_khr_class"
+
+#include <VX/vx.h>
+
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+/*! \brief The Classifier Extension Library Set
+ * \ingroup group_classifier
+ */
+#define VX_LIBRARY_KHR_CLASS_EXTENSION (0x2)
+/*! \brief The list of Classifier Extension Kernels.
+ * \ingroup group_classifier
+ */
+enum vx_kernel_nn_ext_e {
+    /*! \brief The Classifier Extension scan kernel.
+    * \see group_classifier
+    */
+    VX_KERNEL_SCAN_CLASSIFIER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_CLASS_EXTENSION) + 0x0,
+};
+
+/*! \brief Classifier Extension type enums.
+ * \ingroup group_classifier
+ */
+enum vx_class_enum_e
+{
+	VX_ENUM_CLASSIFIER_MODEL= 0x1E, /*!< \brief Classifier model */
+};
+
+/*!
+ * \brief classification model to be used in <tt>\ref vxScanClassifierNode</tt>.
+ * The classification models are loadable by undefined binary format see <tt>\ref vxImportClassifierModel</tt>.
+ * Extensions will be added to the specification, to support a defined binary format.
+ * \ingroup group_object_classifier_model
+ */
+typedef struct _vx_classifier_model* vx_classifier_model;
+
+/*! \brief Classifier model format enums.
+ * In the main specification only undefined binary format is supported. Extensions to the specification will be added in order to support specific binary format.
+ * \ingroup group_object_classifier_model
+ */
+enum vx_classifier_model_format_e
+{
+	/*! \brief Undefined binary format.
+	* Using this enumeration will result in an implementation defined behaviour.
+	*/
+	VX_CLASSIFIER_MODEL_UNDEFINED = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_CLASSIFIER_MODEL ) + 0x0,
+};
+/*! \brief The type enumeration lists all classifier extension types.
+ * \ingroup group_object_classifier_model
+ */
+enum vx_classifier_type_e {
+	VX_TYPE_CLASSIFER_MODEL     = 0x02C,/*!< \brief A <tt>\ref vx_classifier_model</tt>. type */
+};
+
+/*==============================================================================
+ CLASSIFIER MODEL
+ =============================================================================*/
+/*!
+ * \brief Creates an opaque reference classifier model
+ * This function creates a classifier model to be used in <tt>\ref vxScanClassifierNode</tt>. The object classifier object is a read-only constant object. It cannot be changed during graph execution.
+ * \param [in] context Reference to the context where to create the ClassifierModel.
+ * \param [in] format The binary format which contain the classifier model. See <tt>\ref vx_classifier_model_format_e</tt>. Currently only undefined binary format is supported.
+ * Extensions will be added to the specification, to support a classification model defined binary format.
+ * \param [in] ptr A memory pointer to the binary format.
+ * \param [in] length size in bytes of binary format data.
+ * \returns A ClassifierModel reference <tt>\ref vx_classifier_model</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_object_classifier_model
+ */
+VX_API_ENTRY  vx_classifier_model vxImportClassifierModel(vx_context context, vx_enum format, const vx_uint8* ptr, vx_size length);
+
+/*!
+ * \brief Releases a reference of an ClassifierModel object.
+ * The object may not be garbage collected until its total reference and its contained objects
+ * count is zero. After returning from this function the reference is zeroed/cleared.
+ * \param [in] model The pointer to the ClassifierModel to release.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval <tt>\ref VX_SUCCESS</tt> No errors; all other values indicate failure
+ * \retval * An error occurred. See <tt\ref >vx_status_e</tt>.
+ * \ingroup group_object_classifier_model
+ */
+VX_API_ENTRY vx_status vxReleaseClassifierModel(vx_classifier_model* model);
+
+/*! \brief [Graph] Scans a feature-map (input_feature_map) and detect the classification for each scan-window.
+ * \param [in] graph The reference to the graph
+ * \param [in] input_feature_map The Feature-map, example is the output of <tt>\ref vxHOGFeaturesNode</tt>.
+ * \param [in] model The pre-trained model loaded. Loaded using <tt>\ref vxImportClassifierModel</tt>
+ * \param [in] scan_window_width Width of the scan window
+ * \param [in] scan_window_height Height of the scan window
+ * \param [in] step_x Horizontal step-size (along x-axis)
+ * \param [in] step_y Vertical step-size (along y-axis)
+ * \param [out] object_confidences [Optional] An array of confidences measure, the measure is of type <tt>\ref VX_TYPE_UINT16</tt>. The confidence measure is defined by the extensions which define classification model with defined binary format.
+ * This output can be used as class index as well. In case we detect several different classes in single execution. The output will be an array of indexes of the classes.
+ * \param [out] object_rectangles An array of object positions, in <tt>\ref VX_TYPE_RECTANGLE</tt>
+ * \param [out] num_objects [optional] The number of object detected in a <tt>\ref VX_SIZE</tt> scalar
+ * \note The border mode <tt>\ref VX_NODE_BORDER</tt> value <tt>\ref VX_BORDER_UNDEFINED</tt> is supported.
+ * \ingroup group_vision_function_classifier
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+
+VX_API_ENTRY vx_node vxScanClassifierNode(vx_graph graph,vx_tensor input_feature_map, vx_classifier_model model, vx_int32 scanwindow_width, vx_int32 scanwindow_height, vx_int32 step_x, vx_int32 step_y,
+                                     vx_array object_confidences, vx_array object_rectangles, vx_scalar num_objects);
+
+
+#ifdef  __cplusplus
+}
+#endif
+
+
+#endif

+ 80 - 0
include_bakbak/VX/vx_khr_icd.h

@@ -0,0 +1,80 @@
+/*
+
+ * Copyright (c) 2017-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*! \file
+ * \defgroup group_icd OpenVX ICD Loader API
+ * \brief The OpenVX Installable Client Driver (ICD) Loader API.
+ * \details The vx_khr_icd extension provides a mechanism for vendors to implement Installable Client Driver (ICD) for OpenVX. The OpenVX ICD Loader API provides a mechanism for applications to access these vendor implementations.
+ */
+
+#ifndef _VX_KHR_ICD_H_
+#define _VX_KHR_ICD_H_
+
+#include <VX/vx.h>
+#include <VX/vxu.h>
+
+/*! \brief Platform handle of an implementation.
+ *  \ingroup group_icd
+ */
+typedef struct _vx_platform * vx_platform;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief Queries list of available platforms.
+ * \param [in] capacity Maximum number of items that platform[] can hold.
+ * \param [out] platform[] List of platform handles.
+ * \param [out] pNumItems Number of platform handles returned.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_FAILURE If no platforms are found.
+ * \ingroup group_icd
+ */
+vx_status VX_API_CALL vxIcdGetPlatforms(vx_size capacity, vx_platform platform[], vx_size * pNumItems);
+
+/*! \brief Queries the platform for some specific information.
+ * \param [in] platform The platform handle.
+ * \param [in] attribute The attribute to query. Use one of the following:
+ *               <tt>\ref VX_CONTEXT_VENDOR_ID</tt>,
+ *               <tt>\ref VX_CONTEXT_VERSION</tt>,
+ *               <tt>\ref VX_CONTEXT_EXTENSIONS_SIZE</tt>,
+ *               <tt>\ref VX_CONTEXT_EXTENSIONS</tt>.
+ * \param [out] ptr The location at which to store the resulting value.
+ * \param [in] size The size in bytes of the container to which \a ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_ERROR_INVALID_REFERENCE If the platform is not a <tt>\ref vx_platform</tt>.
+ * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
+ * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not supported on this implementation.
+ * \ingroup group_icd
+ */
+vx_status VX_API_CALL vxQueryPlatform(vx_platform platform, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Creates a <tt>\ref vx_context</tt> from a <tt>\ref vx_platform</tt>.
+ * \details This creates a top-level object context for OpenVX from a platform handle.
+ * \returns The reference to the implementation context <tt>\ref vx_context</tt>. Any possible errors
+ * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_icd
+ */
+vx_context VX_API_CALL vxCreateContextFromPlatform(vx_platform platform);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 158 - 0
include_bakbak/VX/vx_khr_ix.h

@@ -0,0 +1,158 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef _OPENVX_IMPORT_EXPORT_H_
+#define _OPENVX_IMPORT_EXPORT_H_
+
+/*!
+ * \file
+ * \brief The OpenVX Export and Import extension API.
+ */
+
+#define OPENVX_KHR_IX  "vx_khr_ix"
+
+#include <VX/vx_import.h>
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/*=============================================================================
+Export to host memory
+=============================================================================*/
+
+/*! \brief Exports selected objects to memory in a vendor-specific format.\n
+ *
+ * \details A list of references in the given context is supplied to this function, and all information
+ * required to re-create these is stored in memory in such a way that those objects may be re-created
+ * with the corresponding import function, according to the usage specified by the *uses* parameter[*REQ*].\n
+ * The information must be context independent in that it may be written to external storage for later
+ * retreival with another instantiation of a compatible implementation[*REQ*].\n
+ * The list of objects to export may contain only valid references (i.e. vxGetStatus() will return VX_SUCCESS)
+ * to vx_graph and non-virtual data objects or the function will fail[*REQ*].
+ * (Specifically not vx_context, vx_import, vx_node, vx_kernel, vx_parameter or vx_meta_format)\n
+ * Some node creation functions take C parameters rather than OpenVX data objects (such as the *gradient_size*
+ * parameter of <tt>\ref vxHarrisCornersNode</tt> that is provided as a vx_int32), because these are intended
+ * to be fixed at node creation time; nevertheless OpenVX data objects may be assigned to them, for example if
+ * the <tt>\ref vxCreateGenericNode</tt> API is used.
+ * A data object corresponding to a node parameter that is intended to be fixed at node creation time must not be
+ * in the list of exported objects nor attached as a graph parameter or the export operation will fail[*REQ*].\n
+ * The *uses* array specifies how the objects in the corresponding *refs* array will be exported. A data object
+ * will always have its meta-data (e.g. dimensions and format of an image) exported, and optionally
+ * may have its data (e.g. pixel values) exported, and additionally you can decide whether the importing
+ * application will create data objects to replace those attached to graphs, or if the implementation will
+ * automatically create them:
+ * - <tt>\ref VX_IX_USE_APPLICATION_CREATE</tt> \n
+ * Export sufficient data to check that an application-supplied
+ * object is compatible when the data is later imported[*REQ*].
+ * \note This value must be given for images created from handles, or the the export operation
+ * will fail[*REQ*]
+ * - <tt>\ref VX_IX_USE_EXPORT_VALUES</tt>\n
+ * Export complete information (for example image data or value of a
+ * scalar)[*REQ*].
+ * - <tt>\ref VX_IX_USE_NO_EXPORT_VALUES</tt>\n
+ * Export meta-data only; the importing application will set values
+ * as applicable[*REQ*]
+ *
+ * The values in *uses* are applicable only for data objects and are ignored for vx_graph objects[*REQ*].\n
+ * If the list *refs* contains vx_graph objects, these graphs will be verified during the export operation and the export operation will fail if verification fails; when successfully exported graphs are subsequently imported they will appear as verified [*REQ*].\n
+ * \note The implementation may also choose to re-verify any previously verified graphs and apply
+ * optimisations based upon which references are to be exported and how.\n
+ * Any data objects attached to a graph that are hidden, i.e. their references are not in the list *refs*,
+ * may be treated by the implementation as virtual objects, since they can never be visible when the graph is
+ * subsequently imported.\n
+ * Note that imported graphs cannot become unverified.  Attempts to change the
+ * graph that might normally cause the graph to be unverified, e.g. calling
+ * vxSetGraphParameterByIndex with an object with different metadata, will fail.\n
+ * The implementation should make sure that all permissible changes of exported objects are possible
+ * without re-verification. For example:
+ * - A uniform image may be swapped for a non-uniform image, so corresponding optimisations should be
+ * inhibited if a uniform image appears in the *refs* list
+ * - An image that is a region of interest of another image may be similarly replaced by any other image of
+ * matching size and format, and vice-versa
+ *
+ * If a graph is exported that has delays registered for auto-aging, then this information is also
+ * exported[*REQ*].\n
+ * If the function is called with NULL for any of its parameters, this is an error [*REQ*].\n
+ * The reference counts of objects as visible to the calling application will not be affected
+ * by calling this function [*REQ*].\n
+ * The export operation will fail if more than one object whose reference is listed at *refs*
+ * has been given the same non-zero length name (via <tt>\ref vxSetReferenceName</tt>)[*REQ*].\n
+ * If a graph listed for export has any graph parameters not listed at *refs*, then the
+ * export operation will fail[*REQ*].
+ * \note The order of the references supplied in the *refs* array will be the order in which the
+ * framwork will supply references for the corresponding import operation with <tt>\ref vxImportObjectsFromMemory</tt>.\n
+ * The same length of *uses* array, containing the same values, and the same value of *numrefs*, must be supplied
+ * for the corresponding import operation.
+ *
+ * For objects not listed in *refs*, the following rules apply:
+ * 1. In any one graph, if an object is not connected as an output of a node in a graph being exported
+ * then its data values will be exported (for subsequent import)[*REQ*].
+ * 2. Where the object in (1) is a composite object (such as a pyramid) then rule (1) applies to
+ * all of its sub-objects[*REQ*].
+ * 3. Where the object in (1) is a sub-object such as a region of interest, and the composite object
+ * (in this case the parent image) does not meet the conditions of rule (1), then rule (1) applies
+ * to the sub-object only[*REQ*].
+ * \param [in] context context from which to export objects, must be valid [*REQ*].
+ * \param [in] numrefs number of references to export [*REQ*].
+ * \param [in] refs references to export. This is an array of length numrefs populated with
+ * the references to export[*REQ*].
+ * \param [in] uses how to export the references. This is an array of length numrefs containing
+ * values as described above[*REQ*].
+ * \param [out] ptr returns pointer to binary buffer. On error this is set to NULL[*REQ*].
+ * \param [out] length number of bytes at \*ptr. On error this is set to zero[*REQ*].
+ * \return A <tt>\ref vx_status</tt> value.
+ * \retval VX_SUCCESS If no errors occurred and the objects were sucessfully exported[*REQ*].
+ * An error is indicated when the return value is not VX_SUCCESS.\n
+ * An implementation may provide several different return values to give useful diagnostic
+ * information in the event of failure to export, but these are not required to indicate
+ * possible recovery mechanisms, and for safety critical use assume errors are not recoverable.
+ * \post <tt>\ref vxReleaseExportedMemory</tt> is used to deallocate the memory.
+ * \ingroup group_import
+ */
+
+VX_API_ENTRY vx_status VX_API_CALL vxExportObjectsToMemory(
+    vx_context context,
+    vx_size numrefs,
+    const vx_reference *refs,
+    const vx_enum * uses,
+    const vx_uint8 ** ptr,
+    vx_size * length);
+
+/*! \brief Releases memory allocated for a binary export when it is no longer required.
+ * \details This function releases memory allocated by <tt>\ref vxExportObjectsToMemory</tt>[*REQ*].
+ * \param [in] context The context for which <tt>\ref vxExportObjectsToMemory</tt> was called[*REQ*].
+ * \param [in,out] ptr A pointer previously set by calling <tt>\ref vxExportObjectsToMemory</tt>[*REQ*].
+ * The function will fail if <code>*ptr</code> does not contain an address of memory previously
+ * allocated by <tt>\ref vxExportObjectsToMemory</tt>[*REQ*].
+ * \post After returning from sucessfully from this function \*ptr is set to NULL[*REQ*].
+ * \return A <tt>\ref vx_status</tt> value.
+ * \retval VX_SUCCESS If no errors occurred and the memory was sucessfully released[*REQ*].\n
+ * An error is indicated when the return value is not VX_SUCCESS[*REQ*].\n
+ * An implementation may provide several different return values to give useful diagnostic
+ * information in the event of failure to export, but these are not required to indicate
+ * possible recovery mechanisms, and for safety critical use assume errors are not recoverable.
+ * \pre <tt>\ref vxExportObjectsToMemory</tt> is used to allocate the memory.
+ * \ingroup group_import
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseExportedMemory(
+    vx_context context, const vx_uint8 ** ptr);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif

+ 532 - 0
include_bakbak/VX/vx_khr_nn.h

@@ -0,0 +1,532 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _VX_KHR_NN_H_
+#define _VX_KHR_NN_H_
+
+/*!
+ * \file
+ * \brief The Khronos Extension for Deep Convolutional Networks Functions.
+ *
+ * \defgroup group_cnn Extension: Deep Convolutional Networks API
+ * \brief Convolutional Network Nodes.
+ */
+
+#define OPENVX_KHR_NN   "vx_khr_nn"
+
+#include <VX/vx.h>
+
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+
+/*==============================================================================
+CONVOLUTIONAL_NETWORK structs and enums
+=============================================================================*/
+
+/*! \brief The Neural Network Extension Library Set
+ * \ingroup group_cnn
+ */
+#define VX_LIBRARY_KHR_NN_EXTENSION (0x1)
+
+/*! \brief The list of Neural Network Extension Kernels.
+ * \ingroup group_cnn
+ */
+enum vx_kernel_nn_ext_e {
+    /*! \brief The Neural Network Extension convolution Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_CONVOLUTION_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x0,
+    /*! \brief The Neural Network Extension fully connected Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_FULLY_CONNECTED_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x1,
+    /*! \brief The Neural Network Extension pooling Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_POOLING_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x2,
+    /*! \brief The Neural Network Extension softmax Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_SOFTMAX_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x3,
+    /*! \brief The Neural Network Extension normalization Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_NORMALIZATION_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x4,
+    /*! \brief The Neural Network Extension activation Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_ACTIVATION_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x5,
+    /*! \brief The Neural Network POI Pooling Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_ROI_POOLING_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x6,
+    /*! \brief The Neural Network Extension Deconvolution Kernel.
+    * \see group_cnn
+    */
+    VX_KERNEL_DECONVOLUTION_LAYER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_NN_EXTENSION) + 0x7,
+};
+
+/*! \brief NN extension type enums.
+ * \ingroup group_cnn
+ */
+enum vx_nn_enum_e
+{
+    VX_ENUM_NN_ROUNDING_TYPE	= 0x1A,
+    VX_ENUM_NN_POOLING_TYPE	= 0x1B,
+    VX_ENUM_NN_NORMALIZATION_TYPE	= 0x1C,
+    VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE	= 0x1D,
+};
+
+/*! \brief down scale rounding.
+ * \details Due to different scheme of downscale size calculation in the various training frameworks. Implementation must support 2 rounding methods for down scale calculation.
+ * The floor and the ceiling. In convolution and pooling functions.
+ * Relevant when input size is even.
+ * \ingroup group_cnn
+ */
+enum vx_nn_rounding_type_e
+{
+    /*! \brief floor rounding  */
+    VX_NN_DS_SIZE_ROUNDING_FLOOR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ROUNDING_TYPE) + 0x0,
+    /*! \brief ceil rounding */
+    VX_NN_DS_SIZE_ROUNDING_CEILING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ROUNDING_TYPE) + 0x1
+};
+
+
+/*! \brief The Neural Network pooling type list.
+ * \details kind of pooling done in pooling function
+ * \ingroup group_cnn
+ */
+enum vx_nn_pooling_type_e
+{
+    /*! \brief max pooling*/
+    VX_NN_POOLING_MAX = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_POOLING_TYPE) + 0x0,
+    /*! \brief average pooling*/
+    VX_NN_POOLING_AVG = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_POOLING_TYPE) + 0x1
+};
+
+
+/*! \brief The Neural Network normalization type list.
+ * \ingroup group_cnn
+ */
+enum vx_nn_norm_type_e
+{
+    /*! \brief normalization is done on same IFM*/
+    VX_NN_NORMALIZATION_SAME_MAP = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_NORMALIZATION_TYPE) + 0x0,
+    /*! \brief Normalization is done across different IFMs*/
+    VX_NN_NORMALIZATION_ACROSS_MAPS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_NORMALIZATION_TYPE) + 0x1,
+};
+
+
+
+/*! \brief The Neural Network activation functions list.
+ * \details
+ * <table>
+ * <tr><td> <B>Function name </B> <td> <B>Mathematical definition</B> <td> <B>Parameters</B> <td> <B>Parameters type</B>
+ * <tr><td>logistic <td> \f$f(x)=1/(1+e^{-x}) \f$  <td>  <td>
+ * <tr><td>hyperbolic tangent <td> \f$f(x)=a\cdot tanh(b\cdot x) \f$  <td> a,b  <td> VX_FLOAT32
+ * <tr><td>relu <td> \f$f(x)=max(0,x)\f$  <td>  <td>
+ * <tr><td>bounded relu <td> \f$f(x)=min(a,max(0,x)) \f$  <td> a  <td> VX_FLOAT32
+ * <tr><td>soft relu <td> \f$f(x)=log(1+e^{x}) \f$  <td>  <td>
+ * <tr><td>abs <td> \f$f(x)=\mid x\mid \f$  <td>  <td>
+ * <tr><td>square <td> \f$f(x)= x^2 \f$  <td>  <td>
+ * <tr><td>square root <td> \f$f(x)=\sqrt{x} \f$  <td>  <td>
+ * <tr><td>linear <td> \f$f(x)=ax+b \f$  <td>  a,b  <td> VX_FLOAT32
+ * </table>
+ * \ingroup group_cnn
+ */
+enum vx_nn_activation_function_e
+{
+    VX_NN_ACTIVATION_LOGISTIC = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x0,
+    VX_NN_ACTIVATION_HYPERBOLIC_TAN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x1,
+    VX_NN_ACTIVATION_RELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x2,
+    VX_NN_ACTIVATION_BRELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x3,
+    VX_NN_ACTIVATION_SOFTRELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x4,
+    VX_NN_ACTIVATION_ABS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x5,
+    VX_NN_ACTIVATION_SQUARE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x6,
+    VX_NN_ACTIVATION_SQRT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x7,
+    VX_NN_ACTIVATION_LINEAR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x8,
+    VX_NN_ACTIVATION_PRELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x9,
+    VX_NN_ACTIVATION_RELU6 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0xA,
+    VX_NN_ACTIVATION_HARDSIGMOID = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0xB,
+};
+
+
+/*! \brief The type enumeration lists all NN extension types.
+ * \ingroup group_cnn
+ */
+enum vx_nn_type_e {
+	VX_TYPE_NN_CONVOLUTION_PARAMS     = 0x025,/*!< \brief A <tt>\ref vx_nn_convolution_params_t</tt>. */
+	VX_TYPE_NN_DECONVOLUTION_PARAMS   = 0x026,/*!< \brief A <tt>\ref vx_nn_deconvolution_params_t</tt>. */
+	VX_TYPE_NN_ROI_POOL_PARAMS        = 0x027,/*!< \brief A <tt>\ref vx_nn_roi_pool_params_t</tt>. */
+	VX_TYPE_NN_PERMUTE_PARAMS         = 0x02D,
+	VX_TYPE_NN_TENSOR_PYRAMID		  = 0x02E,
+	VX_TYPE_NN_CUSTOM_PARAMS		  = 0x02F,
+	//VX_TYPE_VU_EXEC_PARAMS			  = 0x030,
+};
+
+/*! \brief Input parameters for a convolution operation.
+ * \ingroup group_cnn
+ */
+typedef struct _vx_nn_convolution_params_t
+{
+    vx_size padding_xl;                 /*!< \brief Number of elements added at each side in the x dimension of the input. */
+	vx_size padding_xr;
+    vx_size padding_yl;                 /*!< \brief Number of elements added at each side in the y dimension of the input. */
+	vx_size padding_yr;
+	vx_enum overflow_policy;         /*!< \brief A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_convert_policy_e</tt> enumeration. */
+    vx_enum rounding_policy;         /*!< \brief A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_round_policy_e</tt> enumeration. */
+    vx_enum down_scale_size_rounding; /*!< \brief Rounding method for calculating output dimensions. See <tt>\ref vx_nn_rounding_type_e</tt> */
+    vx_size dilation_x;            /*!< \brief “inflate” the kernel by inserting zeros between the kernel elements in the x direction. The value is the number of zeros to insert.*/
+    vx_size dilation_y;            /*!< \brief “inflate” the kernel by inserting zeros between the kernel elements in the y direction. The value is the number of zeros to insert.*/
+	vx_size input_channel;
+	vx_size input_channel_offset;
+	vx_size input_channel_width;
+	vx_size output_channel;
+	vx_size output_channel_offset;
+	vx_size output_channel_width;
+	vx_size group;
+	vx_size executor;
+} vx_nn_convolution_params_t;
+
+/*! \brief Input parameters for a deconvolution operation.
+ * \ingroup group_cnn
+ */
+typedef struct _vx_nn_deconvolution_params_t
+{
+    vx_size padding_x;                 /*!< \brief Number of elements subtracted at each side in the x dimension of the output. */
+    vx_size padding_y;                 /*!< \brief Number of elements subtracted at each side in the y dimension of the output. */
+	vx_enum overflow_policy;         /*!< \brief A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_convert_policy_e</tt> enumeration. */
+    vx_enum rounding_policy;         /*!< \brief A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_round_policy_e</tt> enumeration. */
+    vx_size a_x;                 /*!< \brief user-specified quantity used to distinguish between the \f$upscale_x\f$ different possible output sizes. */
+    vx_size a_y;                 /*!< \brief user-specified quantity used to distinguish between the \f$upscale_y\f$ different possible output sizes. */
+	vx_size input_channel;
+	vx_size input_channel_offset;
+	vx_size input_channel_width;
+	vx_size output_channel;
+	vx_size output_channel_offset;
+	vx_size output_channel_width;
+	vx_size group;
+	vx_size executor;
+} vx_nn_deconvolution_params_t;
+
+typedef struct _vx_nn_custom_params_t
+{
+	vx_float32 params[8];
+}vx_nn_custom_params_t;
+
+/*! \brief Input parameters for ROI pooling operation.
+ * \ingroup group_cnn
+ */
+typedef struct _vx_nn_roi_pool_params_t
+{
+	vx_enum pool_type;  /*!< \brief Of type <tt>\ref vx_nn_pooling_type_e</tt>. Only <tt>\ref VX_NN_POOLING_MAX</tt> pooling is supported. */
+} vx_nn_roi_pool_params_t;
+
+typedef struct _vx_tensor_pyramid_t
+{
+	vx_size num;
+	vx_tensor tensors[8];
+}vx_tensor_pyramid_t;
+
+typedef struct _vx_tensor_array_t
+{
+	vx_size num;
+	vx_tensor tensors[128];
+}vx_tensor_array_t;
+
+typedef struct _vx_nn_permute_params_t
+{
+    vx_size axis_order0;
+    vx_size axis_order1;
+    vx_size axis_order2;
+    vx_size axis_order3;
+}vx_nn_permute_params_t;
+
+/*==============================================================================
+    NN Nodes
+=============================================================================*/
+/*! \brief [Graph] Creates a Convolutional Network Convolution Layer Node.
+ * \details This function implement Convolutional Network Convolution layer.
+ *  For fixed-point data types, a fixed point calculation is performed with round and saturate according to the number of accumulator bits. The number of the accumulator bits are implementation defined,
+ * and should be at least 16.\n
+ * round: rounding according the <tt>vx_round_policy_e</tt> enumeration. \n
+ * saturate: A saturation according the <tt>vx_convert_policy_e</tt> enumeration.
+ * The following equation is implemented: \n
+ * \f$ outputs[j,k,i] = saturate(round(\sum_{l} (\sum_{m,n} inputs[j+m,k+n,l] \times weights[m,n,l,i])+biasses[j,k,i])) \f$\n
+ * Where \f$m,n\f$ are indexes on the convolution matrices. \f$ l\f$ is an index on all the convolutions per input.\f$ i\f$ is an index per output.
+ * \f$ j,k \f$ are the inputs/outputs spatial indexes.
+ * Convolution is done on the width and height dimensions of the <tt>\ref vx_tensor</tt>. Therefore, we use here the term x for index along the width dimension and y for index along the height dimension.\n
+ * before the Convolution is done, a padding with zeros of the width and height input dimensions is performed.
+ * Then down scale is done by picking the results according to a skip jump. The skip in the x and y is determined by the output size dimensions.
+ * The relation between input to output is as follows: \n
+ * \f$ width_{output} = round(\frac{(width_{input} + 2 * padding_x - kernel_x - (kernel_x -1) * dilation_x)}{skip_x} + 1) \f$\n
+ * and \n
+ * \f$ height_{output} = round(\frac{(height + 2 * padding_y - kernel_y - (kernel_y -1) * dilation_y)}{skip_y} + 1) \f$\n
+ * where \f$width\f$ is the size of the input width dimension. \f$height\f$ is the size of the input height dimension.
+ * \f$width_{output}\f$ is the size of the output width dimension. \f$height_{output}\f$ is the size of the output height dimension.
+ * \f$kernel_x\f$ and \f$kernel_y\f$ are the convolution sizes in width and height dimensions.
+ * skip is calculated by the relation between input and output. In case of ambiguity in the inverse calculation of the skip. The minimum solution is chosen. Skip must be a positive non zero integer.
+ * rounding is done according to <tt>\ref vx_nn_rounding_type_e</tt>.
+ * Notice that this node creation function has more parameters than the corresponding kernel. Numbering of kernel parameters (required if you create this node using the generic interface) is explicitly specified here.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data. 3 lower dimensions represent a single input, all following dimensions represent number of batches, possibly nested.
+ * The dimension order is [width, height, #IFM, #batches]\n. Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'.  (Kernel parameter #0)
+ * \param [in] weights [static] Weights are 4d tensor with dimensions [kernel_x, kernel_y, #IFM, #OFM]. see <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt> \n Weights data type must match the data type of the inputs.  (Kernel parameter #1)
+ * \param [in] biases [static] Optional, ignored if NULL. The biases, which may be shared (one per ofm) or unshared (one per ofm * output location). The possible layouts are
+ * either [#OFM] or [width, height, #OFM]. Biases data type must match the data type of the inputs.   (Kernel parameter #2)
+ * \param [in] convolution_params [static] Pointer to parameters of type <tt>\ref vx_nn_convolution_params_t</tt>.  (Kernel parameter #3)
+ * \param [in] size_of_convolution_params [static] Size in bytes of convolution_params. Note that this parameter is not counted as one of the kernel parameters.
+ * \param [out] outputs The output tensor data. Output will have the same number and structure of dimensions as input. Output tensor data type must be same as the inputs.  (Kernel parameter #4)
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_cnn
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxConvolutionLayer(vx_graph graph,
+													vx_tensor inputs,
+													vx_tensor weights,
+													vx_tensor biases,
+													const vx_nn_convolution_params_t *convolution_params,
+													vx_size size_of_convolution_params,
+													vx_tensor outputs);
+
+/*! \brief [Graph] Creates a Fully connected Convolutional Network Layer Node.
+ * \details This function implement Fully connected Convolutional Network layers.
+ * For fixed-point data types, a fixed point calculation is performed with round and saturate according to the number of accumulator bits. The number of the accumulator bits are implementation defined,
+ * and should be at least 16.\n
+ * round: rounding according the <tt>vx_round_policy_e</tt> enumeration. \n
+ * saturate: A saturation according the <tt>vx_convert_policy_e</tt> enumeration.
+ * The equation for Fully connected layer:\n
+ * \f$ outputs[i] = saturate(round(\sum_{j} (inputs[j] \times weights[j,i])+biasses[i])) \f$\n
+ * Where \f$j\f$ is a index on the input feature and \f$i\f$ is a index on the output.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data. There two possible input layouts:
+ * 1. [#IFM, #batches]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * 2. [width, height, #IFM, #batches]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>\n
+ * In both cases number of batches are optional and may be multidimensional.
+ * The second option is a special case to deal with convolution layer followed by fully connected.
+ * The dimension order is [#IFM, #batches]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>. Note that batch may be multidimensional. Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'. 
+ * \param [in] weights [static] Number of dimensions is 2. Dimensions are [#IFM, #OFM]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.\n Implementations must support input tensor data type same as the inputs.
+ * \param [in] biases [static] Optional, ignored if NULL. The biases have one dimension [#OFM]. Implementations must support input tensor data type same as the inputs.
+ * \param [in] overflow_policy [static] A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_convert_policy_e</tt> enumeration.
+ * \param [in] rounding_policy [static] A <tt> VX_TYPE_ENUM</tt> of the <tt> vx_round_policy_e</tt> enumeration.
+ * \param [out] outputs The output tensor data. Output dimension layout is [#OFM,#batches]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>, where #batches may be multidimensional. Output tensor data type must be same as the inputs.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_cnn
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxFullyConnectedLayer(vx_graph graph, vx_tensor inputs, vx_tensor weights, vx_tensor biases, vx_enum overflow_policy, vx_enum rounding_policy, vx_tensor outputs);
+
+
+/*! \brief [Graph] Creates a Convolutional Network Pooling Layer Node.
+ * \details Pooling is done on the width and height dimensions of the <tt>\ref vx_tensor</tt>. Therefore, we use here the term x for the width dimension and y for the height dimension.\n
+ * Pooling operation is a function operation over a rectangle size and then a nearest neighbour down scale.
+ * Here we use pooling_size_x and pooling_size_y to specify the rectangle size on which the operation
+ * is performed. \n
+ * before the operation is done (average or maximum value). the data is padded with zeros in width and height dimensions .
+ * The down scale is done by picking the results according to a skip jump. The skip in the x and y dimension is determined by the output size dimensions.
+ * The first pixel of the down scale output is the first pixel in the input.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data. 3 lower dimensions represent a single input, 4th dimension for batch of inputs is optional.Dimension layout is [width, height, #IFM, #batches].
+ * See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>
+ * Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'.
+ * \param [in] pooling_type [static] Either max pooling or average pooling (see <tt>\ref vx_nn_pooling_type_e</tt>).
+ * \param [in] pooling_size_x [static] Size of the pooling region in the x dimension
+ * \param [in] pooling_size_y [static] Size of the pooling region in the y dimension.
+ * \param [in] pooling_padding_x [static] Padding size in the x dimension.
+ * \param [in] pooling_padding_y [static] Padding size in the y dimension.
+ * \param [in] rounding [static] Rounding method for calculating output dimensions. See <tt>\ref vx_nn_rounding_type_e</tt>
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input. Output tensor data type must be same as the inputs.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ * \ingroup group_cnn
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxPoolingLayer(vx_graph graph, vx_tensor inputs, vx_enum pooling_type,
+        vx_size pooling_size_x,
+        vx_size pooling_size_y,
+        vx_size pooling_padding_x,
+        vx_size pooling_padding_y,
+		vx_size executor,
+        vx_enum rounding,
+        vx_tensor outputs);
+
+/*! \brief [Graph] Creates a Convolutional Network Softmax Layer Node.
+ * \details  the softmax function, is a generalization of the logistic function that "squashes" a K-dimensional vector \f$ z \f$ of arbitrary real values to a K-dimensional vector
+ * \f$ \sigma(z) \f$ of real values in the range (0, 1) that add up to 1. The function is given by:
+ * \f$ \sigma(z) = \frac{\exp^z}{\sum_i \exp^{z_i}} \f$
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor,  with the number of dimensions according to the following scheme.
+ * In case IFM dimension is 1. Softmax is be calculated on that dimension.
+ * In case IFM dimension is 2. Softmax is be calculated on the first dimension. The second dimension is batching.
+ * In case IFM dimension is 3. Dimensions are [Width, Height, Classes]. And Softmax is calculated on the third dimension.
+ * In case IFM dimension is 4. Dimensions are [Width, Height, Classes, batching]. Softmax is calculated on the third dimension.
+ * Regarding the layout specification, see <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * In all cases Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'.
+ * \param [out] outputs The output tensor. Output will have the same number of dimensions as input. Output tensor data type must be same as the inputs.
+ * \ingroup group_cnn
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+
+VX_API_ENTRY vx_node VX_API_CALL vxSoftmaxLayer(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+
+/*! \brief [Graph] Creates a Convolutional Network Normalization Layer Node. This function is optional for 8-bit extension with the extension string 'KHR_NN_8'. 
+ * \details Normalizing over local input regions. Each input value is divided by \f$ (1+\frac{\alpha}{n}\sum_i x^2_i)^\beta \f$ , where n is the number of elements to normalize across.
+ * and the sum is taken over a rectangle region centred at that value (zero padding is added where necessary).
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data. 3 lower dimensions represent a single input, 4th dimension for batch of inputs is optional.Dimension layout is [width, height, IFM, #batches].
+ * See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8 KHR_NN_16'.
+ * Since this function is optional for 'KHR_NN_8', so implementations only must support <tt>VX_TYPE_INT16</tt> with fixed_point_position 8.
+ * \param [in] type [static] Either same map or across maps (see <tt>\ref vx_nn_norm_type_e</tt>).
+ * \param [in] normalization_size [static] Number of elements to normalize across. Must be a positive odd number with maximum size of 7 and minimum of 3.
+ * \param [in] alpha [static] Alpha parameter in the normalization equation. must be positive.
+ * \param [in] beta  [static] Beta parameter in the normalization equation. must be positive.
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input.
+ * \ingroup group_cnn
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxNormalizationLayer(
+	vx_graph graph,
+	vx_tensor inputs,
+	vx_tensor scale,
+	vx_bool across_spatial,
+	vx_bool channel_shared,
+	vx_tensor outputs);
+
+/*! \brief [Graph] Creates a Convolutional Network Activation Layer Node.
+ * The function operate a specific function (Specified in <tt>\ref vx_nn_activation_function_e</tt>), On the input data.
+ * the equation for the layer is:
+ * \f$ outputs(i,j,k,l) = function(inputs(i,j,k,l), a, b) \f$ for all i,j,k,l.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'.
+ * \param [in] function [static] Non-linear function (see <tt>\ref vx_nn_activation_function_e</tt>). Implementations must support <tt>\ref VX_NN_ACTIVATION_LOGISTIC</tt>, <tt>\ref VX_NN_ACTIVATION_HYPERBOLIC_TAN</tt> and <tt>\ref VX_NN_ACTIVATION_RELU</tt>
+ * \param [in] a [static] Function parameters a. must be positive.
+ * \param [in] b [static] Function parameters b. must be positive.
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input.
+ * \ingroup group_cnn
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxActivationLayer(vx_graph graph, vx_tensor inputs, vx_enum function, vx_tensor weights, vx_tensor outputs);
+
+/*! \brief [Graph] Creates a Convolutional Network ROI pooling node
+ * \details Pooling is done on the width and height dimensions of the <tt>\ref vx_tensor</tt>. The ROI Pooling get an array of roi rectangles, and an input tensor.
+ * The kernel crop the width and height dimensions of the input tensor with the ROI rectangles and down scale the result to the size of the output tensor. The output tensor width and height are the pooled width and pooled height.
+ * The down scale method is determined by the pool_type.
+ * Notice that this node creation function has more parameters than the corresponding kernel. Numbering of kernel parameters (required if you create this node using the generic interface) is explicitly specified here.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data. 3 lower dimensions represent a single input, 4th dimension for batch of inputs is optional. Dimension layout is [width, height, #IFM, #batches].
+ * See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'.  (Kernel parameter #0)
+ * \param [in] inputs_rois The roi array tensor. ROI array with dimensions [4, roi_count, #batches] where the first dimension represents 4 coordinates of the top left and bottom right corners of the roi rectangles, based on the input tensor width and height.
+ * #batches is optional and must be the same as in inputs. roi_count is the number of ROI rectangles.  (Kernel parameter #1)
+ * \param [in] pool_type [static] Of type <tt>\ref vx_nn_pooling_type_e</tt>. Only <tt>\ref VX_NN_POOLING_MAX</tt> pooling is supported.   (Kernel parameter #2)
+ * \param [in] size_of_roi_params [static] Size in bytes of roi_pool_params. Note that this parameter is not counted as one of the kernel parameters.
+ * \param [out] output_arr The output tensor. Output will have [output_width, output_height, #IFM, #batches] dimensions. #batches is optional and must be the same as in inputs.  (Kernel parameter #3)
+ * \ingroup group_cnn
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node vxROIPoolingLayer(vx_graph graph, vx_tensor input_data, vx_tensor input_rois, const vx_nn_roi_pool_params_t *roi_pool_params, vx_size size_of_roi_params, vx_tensor output_arr);
+
+
+/*! \brief [Graph] Creates a Convolutional Network Deconvolution Layer Node.
+ * \details  Deconvolution denote a sort of reverse convolution, which importantly and confusingly is not actually a proper mathematical deconvolution.
+ * Convolutional Network Deconvolution is up-sampling of an image by learned Deconvolution coefficients.
+ * The operation is similar to convolution but can be implemented by up-sampling the inputs with zeros insertions between the inputs,
+ * and convolving the Deconvolution kernels on the up-sampled result.
+ * For fixed-point data types, a fixed point calculation is performed with round and saturate according to the number of accumulator bits. The number of the accumulator bits are implementation defined,
+ * and should be at least 16.\n
+ * round: rounding according the <tt>vx_round_policy_e</tt> enumeration. \n
+ * saturate: A saturation according the <tt>vx_convert_policy_e</tt> enumeration.
+ * The following equation is implemented: \n
+ * \f$ outputs[j,k,i] =  saturate(round(\sum_{l} \sum_{m,n}(inputs_{upscaled}[j+m,k+n,l] \times weights[m,n,l,i])+biasses[j,k,i])) \f$\n
+ * Where \f$m,n\f$ are indexes on the convolution matrices. \f$ l\f$ is an index on all the convolutions per input.\f$ i\f$ is an index per output.
+ * \f$ j,k \f$ are the inputs/outputs spatial indexes.
+ * Deconvolution is done on the width and height dimensions of the <tt>\ref vx_tensor</tt>. Therefore, we use here the term x for the width dimension and y for the height dimension.\n
+ * before the Deconvolution is done, up-scaling the width and height dimensions with zeros is performed.
+ * The relation between input to output is as follows: \n
+ * \f$ width_{output} =  (width_{input} -1) * upscale_x  - 2 * padding_x + kernel_x + a_x \f$\n
+ * and \n
+ * \f$ height_{output} =  (height_{input} - 1) * upscale_y - 2 * padding_y + kernel_y + a_y \f$\n
+ * where \f$width_{input}\f$ is the size of the input width dimension. \f$height_{input}\f$ is the size of the input height dimension.
+ * \f$width_{output}\f$ is the size of the output width dimension. \f$height_{output}\f$ is the size of the output height dimension.
+ * \f$kernel_x\f$ and \f$kernel_y\f$ are the convolution sizes in width and height. \f$a_x\f$ and \f$a_y\f$ are user-specified quantity used to distinguish between the \f$upscale_x\f$ and \f$upscale_y\f$ different possible output sizes.
+ * \f$upscale_x\f$ and \f$upscale_y\f$ are calculated by the relation between input and output.
+ * \f$a_x\f$ and \f$a_y\f$ must be positive and smaller then \f$upscale_x\f$ and \f$upscale_y\f$ respectively.
+ * Since the padding parameter is on the output. The effective input padding is: \n
+ * \f$ padding_{input_x} = kernel_x -padding_x -1\f$ \n
+ * \f$ padding_{input_y} = kernel_y -padding_y -1\f$ \n
+ * Therfore the following constarints apply : \f$kernel_x >= padding_x - 1\f$ and \f$kernel_y >= padding_y - 1\f$.
+ * rounding is done according to <tt>\ref vx_nn_rounding_type_e</tt>.
+ * Notice that this node creation function has more parameters than the corresponding kernel. Numbering of kernel parameters (required if you create this node using the generic interface) is explicitly specified here.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor. 3 lower dimensions represent a single input, and an optional 4th dimension for batch of inputs. Dimension layout is [width, height, #IFM, #batches].
+ * See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * Implementations must support input tensor data types indicated by the extension strings 'KHR_NN_8' or 'KHR_NN_8 KHR_NN_16'.   (Kernel parameter #0)
+ * \param [in] weights [static] The 4d weights with dimensions [width, height, #IFM, #OFM]. See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.  (Kernel parameter #1)
+ * \param [in] biases [static] Optional, ignored if NULL. The biases have one dimension [#OFM]. Implementations must support input tensor data type same as the inputs.  (Kernel parameter #2)
+ * \param [in] deconvolution_params [static] Pointer to parameters of type <tt>\ref vx_nn_deconvolution_params_t</tt>  (Kernel parameter #3)
+ * \param [in] size_of_deconv_params [static] Size in bytes of deconvolution_params. Note that this parameter is not counted as one of the kernel parameters.
+ * \param [out] outputs The output tensor. The output has the same number of dimensions as the input.  (Kernel parameter #4)
+ * \ingroup group_cnn
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxDeconvolutionLayer(vx_graph graph, vx_tensor inputs, vx_tensor weights, vx_tensor  biases, const vx_nn_deconvolution_params_t *deconvolution_params, vx_size size_of_deconv_params, vx_tensor outputs);
+
+
+//register custom kernel
+enum DataType {
+	invalid,
+	int8,
+	float32,
+};
+
+typedef struct quant_params_t {
+	DataType type;
+	int bw;
+	int fl;
+}quant_params;
+
+typedef int (*custom_kernel)(int input_dims[4], quant_params * input_quant_params, void * input_data,
+							int weight_dims[4], quant_params * weight_quant_params, void * weight_data,
+							int bias_dims[4], quant_params * bias_quant_params, void * bias_data,
+							int output_dims[4], quant_params * output_quant_params, void * output_data,
+							float custom_params[8]);
+VX_API_ENTRY vx_status VX_API_CALL register_custom_kernel(const char * name, custom_kernel kernel_func);
+VX_API_ENTRY vx_status VX_API_CALL unregister_custom_kernel(const char * name);
+
+#ifdef  __cplusplus
+}
+#endif
+
+
+#endif

+ 372 - 0
include_bakbak/VX/vx_khr_tiling.h

@@ -0,0 +1,372 @@
+/* 
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _VX_KHR_TILING_H_
+#define _VX_KHR_TILING_H_
+
+/*!
+ * \file
+ * \brief The Khronos Extension for User Tiling Functions.
+ *
+ * \defgroup group_tiling Extension: User Tiling API
+ * \brief The Khronos Extension for User Tiling Functions.
+ */
+
+#define OPENVX_KHR_TILING   "vx_khr_tiling"
+
+#if defined(OPENVX_TILING_1_0)
+#undef OPENVX_TILING_1_1
+#endif
+
+#include <VX/vx.h>
+/* For vx_kernel_input_validate_f and vx_kernel_output_validate_f: */
+#include <VX/vx_compatibility.h>
+
+
+/*! \def VX_RESTRICT
+ * \brief A platform wrapper for the restrict keyword.
+ * \ingroup group_tiling
+ */
+#if defined(_WIN32)
+#define VX_RESTRICT
+#else
+#if defined(__cplusplus) || defined(ANDROID)
+#define VX_RESTRICT     __restrict
+#else
+#define VX_RESTRICT     restrict
+#endif
+#endif
+
+/*! \brief The User Tiling Function tile block size declaration.
+ * \details The author of a User Tiling Kernel will use this structure to define
+ * the dimensionality of the tile block.
+ * \ingroup group_tiling
+ */
+typedef struct _vx_tile_block_size_t {
+    vx_int32 width; /*!< \brief Tile block width in pixels. */
+    vx_int32 height; /*!< \brief Tile block height in pixels. */
+} vx_tile_block_size_t;
+
+/*! \brief The User Tiling Function Neighborhood declaration.
+ * \details The author of a User Tiling Kernel will use this structure to define
+ * the neighborhood surrounding the tile block.
+ * \ingroup group_tiling
+ */
+typedef struct _vx_neighborhood_size_t {
+    vx_int32 left;   /*!< \brief Left of the tile block. */
+    vx_int32 right;  /*!< \brief Right of the tile block. */
+    vx_int32 top;    /*!< \brief Top of the tile block. */
+    vx_int32 bottom; /*!< \brief Bottom of the tile block. */
+} vx_neighborhood_size_t;
+
+/*! \brief A structure which describes the tile's parent image.
+ * \ingroup group_tiling
+ */
+typedef struct _vx_image_description_t {
+    vx_uint32 width;  /*!< \brief Width of the image */
+    vx_uint32 height; /*!< \brief Height of the image */
+    vx_df_image format; /*!< \brief The <tt>\ref vx_df_image_e</tt> of the image */
+    vx_uint32 planes; /*!< \brief The number of planes in the image */
+    vx_enum range;    /*!< \brief The <tt>\ref vx_channel_range_e</tt> enumeration. */
+    vx_enum space;    /*!< \brief The <tt>\ref vx_color_space_e</tt> enumeration. */
+} vx_image_description_t;
+
+/*! \brief The maximum number of planes in a tiled image.
+ * \ingroup group_tiling
+ */
+#define VX_MAX_TILING_PLANES (4)
+
+/*! \brief The tile structure declaration.
+ * \ingroup group_tiling
+ */
+typedef struct _vx_tile_t {
+    /*! \brief The array of pointers to the tile's image plane. */
+    vx_uint8 * VX_RESTRICT base[VX_MAX_TILING_PLANES];
+    /*! \brief The top left X pixel index within the width dimension of the image. */
+    vx_uint32 tile_x;
+    /*! \brief The top left Y pixel index within the height dimension of the image. */
+    vx_uint32 tile_y;
+    /*! \brief The array of addressing structure to describe each plane. */
+    vx_imagepatch_addressing_t addr[VX_MAX_TILING_PLANES];
+    /*! \brief The output block size structure. */
+    vx_tile_block_size_t tile_block;
+    /*! \brief The neighborhood definition. */
+    vx_neighborhood_size_t neighborhood;
+    /*! \brief The description and attributes of the image. */
+    vx_image_description_t image;
+} vx_tile_t;
+
+#ifndef VX_TILE_ATTRIBUTES_DEFINITIONS
+
+/*!
+ * \brief The full height of the tile's parent image in pixels.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxImageHeight(ptile)    ((ptile))->image.height)
+
+/*!
+ * \brief The full width of the tile's parent image in pixels.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxImageWidth(ptile)   ((ptile))->image.width)
+
+/*!
+ * \brief The offset between the left edge of the image and the left edge of the tile, in pixels.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxTileX(ptile)        ((ptile)->tile_x)
+
+/*!
+ * \brief The offset between the top edge of the image and the top edge of the tile, in pixels.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxTileY(ptile)        ((ptile)->tile_y)
+
+/*!
+ * \brief The width of the tile in pixels.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \param [in] index The plane index.
+ * \ingroup group_tiling
+ */
+#define vxTileWidth(ptile, index)    ((ptile)->addr[index].dim_x)
+
+/*!
+ * \brief The height of the tile in pixels.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \param [in] index The plane index.
+ * \ingroup group_tiling
+ */
+#define vxTileHeight(ptile, index)   ((ptile)->addr[index].dim_y)
+
+/*!
+ * \brief The tile block height.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxTileBlockHeight(ptile)     ((ptile)->tile_block.height)
+
+/*!
+ * \brief The tile block width.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxTileBlockWidth(ptile)      ((ptile)->tile_block.width)
+
+/*!
+ * \brief The simple wrapper to access each image's neighborhood -X value.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxNeighborhoodLeft(ptile)    ((ptile)->neighborhood.left)
+
+/*!
+ * \brief The simple wrapper to access each image's neighborhood +X value.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxNeighborhoodRight(ptile)   ((ptile)->neighborhood.right)
+
+/*!
+ * \brief The simple wrapper to access each image's neighborhood -Y value.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxNeighborhoodTop(ptile)     ((ptile)->neighborhood.top)
+
+/*!
+ * \brief The simple wrapper to access each image's neighborhood +Y value.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxNeighborhoodBottom(ptile)  ((ptile)->neighborhood.bottom)
+
+#if 0
+/*!
+ * \brief The simple wrapper to access each image's stride X value.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxStrideSizeX(ptile, index)  ((ptile)->addr[index].stride_x)
+
+/*!
+ * \brief The simple wrapper to access each image's stride Y value.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxStrideSizeY(ptile, index)  ((ptile)->addr[index].stride_y)
+
+/*!
+ * \brief The simple wrapper to access each image's step X value.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxStepSizeX(ptile, index)    ((ptile)->addr[index].step_x)
+
+/*!
+ * \brief The simple wrapper to access each image's step Y value.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \ingroup group_tiling
+ */
+#define vxStepSizeY(ptile, index)    ((ptile)->addr[index].step_y)
+#endif
+
+#endif
+
+/*! \brief The User Kernel Tiling Attributes.
+ * \ingroup group_tiling
+ */
+enum vx_kernel_attribute_tiling_e {
+    /*! \brief This allows a tiling mode kernel to set its input neighborhood. */
+    VX_KERNEL_INPUT_NEIGHBORHOOD      = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x7,
+    /*! \brief This allows a tiling mode kernel to set its output tile block size. */
+    VX_KERNEL_OUTPUT_TILE_BLOCK_SIZE  = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x8,
+    /*! \brief This allows the author to set the border mode on the tiling kernel. */
+    VX_KERNEL_BORDER                  = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x9,
+    /*! \brief This determines the per tile memory allocation. */
+    VX_KERNEL_TILE_MEMORY_SIZE        = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0xA,
+#if defined(OPENVX_TILING_1_1)
+    /*! \brief This allows a tiling mode kernel to set its input tile block size. */
+    VX_KERNEL_INPUT_TILE_BLOCK_SIZE   = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0xB,
+    /*! \brief This allows a tiling mode kernel to set its output neighborhood. */
+    VX_KERNEL_OUTPUT_NEIGHBORHOOD     = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0xC,
+#endif
+};
+
+/*! \brief The User Node Tiling Attributes.
+ * \note These are largely unusable by the tiling function, as it doesn't give you the node reference!
+ * \ingroup group_tiling
+ */
+enum vx_node_attribute_tiling_e {
+    /*! \brief This allows a tiling mode node to get its input neighborhood. */
+    VX_NODE_INPUT_NEIGHBORHOOD      = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xB,
+    /*! \brief This allows a tiling mode node to get its output tile block size. */
+    VX_NODE_OUTPUT_TILE_BLOCK_SIZE  = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xC,
+    /*! \brief This is the size of the tile local memory area. */
+    VX_NODE_TILE_MEMORY_SIZE        = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xD,
+#if defined(OPENVX_TILING_1_1)
+    /*! \brief This allows a tiling mode node to get its input tile block size. */
+    VX_NODE_INPUT_TILE_BLOCK_SIZE   = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xE,
+    /*! \brief This allows a tiling mode node to get its output neighborhood. */
+    VX_NODE_OUTPUT_NEIGHBORHOOD     = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xF,
+#endif
+};
+
+/*! \brief The tiling border mode extensions
+ * \ingroup group_tiling
+ */
+enum vx_border_tiling_e {
+    /*! \brief This value indicates that the author of the tiling kernel wrote
+     * code to handle border conditions into the kernel itself. If this mode
+     * is set, it can not be overriden by a call to the \ref vxSetNodeAttribute
+     * with \ref VX_NODE_BORDER.
+     */
+    VX_BORDER_MODE_SELF = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_BORDER) + 0x3,
+};
+
+/*! \typedef vx_tiling_kernel_f
+ * \brief Tiling Kernel function typedef for User Tiling Kernels.
+ * \note Tiles may come in any dimension and are not guaranteed to be delivered in
+ * any particular order.
+ * \param [in] parameters The array abstract pointers to parameters.
+ * \param [in] tile_memory The local tile memory pointer if requested, otherwise NULL.
+ * \param [in] tile_memory_size The size of the local tile memory, if not requested, 0.
+ * \ingroup group_tiling
+ */
+#ifdef __cplusplus
+typedef void (*vx_tiling_kernel_f)(void * VX_RESTRICT parameters[],
+                                   void * VX_RESTRICT tile_memory,
+                                   vx_size tile_memory_size);
+#else
+typedef void (*vx_tiling_kernel_f)(void * VX_RESTRICT parameters[VX_RESTRICT],
+                                   void * VX_RESTRICT tile_memory,
+                                   vx_size tile_memory_size);
+#endif
+
+#ifndef VX_IMAGE_PIXEL_DEFINITION
+
+/*! \def vxImageOffset
+ * \brief Computes the offset within an image.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \param [in] i The plane index.
+ * \param [in] x The Width Coordinates.
+ * \param [in] y The Height Coordinates.
+ * \param [in] ox The X offset.
+ * \param [in] oy The Y offset.
+ * \ingroup group_tiling
+ */
+#define vxImageOffset(ptile, i, x, y, ox, oy) \
+        ((ptile)->addr[i].stride_y * (vx_int32)(((vx_int32)((oy)+(y)) * (vx_int32)(ptile)->addr[i].scale_y)/(vx_int32)VX_SCALE_UNITY)) + \
+        ((ptile)->addr[i].stride_x * (vx_int32)(((vx_int32)((ox)+(x)) * (vx_int32)(ptile)->addr[i].scale_x)/(vx_int32)VX_SCALE_UNITY))
+
+
+/*! \def vxImagePixel
+ * \brief Accesses an image pixel as a type-cast indexed pointer dereference.
+ * \param [in] type The type of the image pixel. Example values are <tt>\ref vx_uint8</tt>, <tt>\ref vx_uint16</tt>, <tt>\ref vx_uint32</tt>, etc.
+ * \param [in] ptile The pointer to the \ref vx_tile_t structure.
+ * \param [in] i The plane index.
+ * \param [in] x The Center Pixel in Width Coordinates.
+ * \param [in] y The Center Pixel in Height Coordinates.
+ * \param [in] ox The X offset.
+ * \param [in] oy The Y offset.
+ * \ingroup group_tiling
+ */
+#define vxImagePixel(type, ptile, i, x, y, ox, oy) \
+    *((type *)(&((vx_uint8 *)(ptile)->base[i])[vxImageOffset(ptile, i, x, y, ox, oy)]))
+
+#endif
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/*! \brief Allows a user to add a tile-able kernel to the OpenVX system.
+ * \param [in] context The handle to the implementation context.
+ * \param [in] name The string to be used to match the kernel.
+ * \param [in] enumeration The enumerated value of the kernel to be used by clients.
+ * \param [in] flexible_func_ptr The process-local flexible function pointer to be invoked.
+ * \param [in] fast_func_ptr The process-local fast function pointer to be invoked.
+ * \param [in] num_params The number of parameters for this kernel.
+ * \param [in] input The pointer to a function which will validate the
+ * input parameters to this kernel.
+ * \param [in] output The pointer to a function which will validate the
+ * output parameters to this kernel.
+ * \note Tiling Kernels do not have access to any of the normal node attributes listed
+ * in \ref vx_node_attribute_e.
+ * \post Call <tt>\ref vxAddParameterToKernel</tt> for as many parameters as the function has,
+ * then call <tt>\ref vxFinalizeKernel</tt>.
+ * \retval 0 Indicates that an error occurred when adding the kernel.
+ * Note that the fast or flexible formula, but not both, can be NULL.
+ * \ingroup group_tiling
+ */
+VX_API_ENTRY vx_kernel VX_API_CALL vxAddTilingKernel(vx_context context,
+                            vx_char name[VX_MAX_KERNEL_NAME],
+                            vx_enum enumeration,
+                            vx_tiling_kernel_f flexible_func_ptr,
+                            vx_tiling_kernel_f fast_func_ptr,
+                            vx_uint32 num_params,
+                            vx_kernel_input_validate_f input,
+                            vx_kernel_output_validate_f output);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif

+ 156 - 0
include_bakbak/VX/vx_khr_xml.h

@@ -0,0 +1,156 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _VX_KHR_XML_H_
+#define _VX_KHR_XML_H_
+
+/*! \file
+ * \brief The OpenVX XML Schema Extension Header.
+ *
+ * \defgroup group_xml Extension: XML API
+ * \brief The Khronos Extension for OpenVX XML Import and Export Support.
+ */
+
+#define OPENVX_KHR_XML  "vx_khr_xml"
+
+#include <VX/vx.h>
+
+/*! \brief The Object Type Enumeration for Imports.
+ * \ingroup group_xml
+ */
+enum vx_ext_import_type_e {
+    VX_TYPE_IMPORT = 0x814,/*!< \brief A <tt>\ref vx_import</tt> */
+};
+
+/*! \brief The import type enumeration.
+ * \ingroup group_xml
+ * \see VX_IMPORT_ATTRIBUTE_TYPE
+ */
+enum vx_ext_import_types_e {
+    VX_IMPORT_TYPE_XML = 0,/*!< \brief The XML import type */
+};
+
+/*! \brief The import attributes list
+ * \ingroup group_xml
+ * \see vxQueryImport
+ */
+enum vx_import_attribute_e {
+    /*! \brief Returns the number of references in the import object. Use a <tt>\ref vx_uint32</tt> parameter.*/
+    VX_IMPORT_ATTRIBUTE_COUNT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMPORT) + 0x0,
+    /*! \brief Returns the type of import. Use a <tt>\ref vx_ext_import_types_e </tt> parameter */
+    VX_IMPORT_ATTRIBUTE_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMPORT) + 0x1,
+};
+
+/*! \brief An abstract handle to an import object.
+ * \ingroup group_xml
+ * \extends vx_reference
+ */
+typedef struct _vx_import *vx_import;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief Exports all objects in the context to an XML file which uses the OpenVX
+ * XML Schema.
+ * \param [in] context The context to export.
+ * \param [in] xmlfile The file name to write the XML into.
+ * \note The reference numbers contained in the xml file can appear in any order but
+ * should be inclusive from index number 0 to [number of references - 1]. For example,
+ * if there are 20 references in the xml file, none of the reference indices should be >= 20.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \see https://www.khronos.org/registry/vx/schema/openvx-1-1.xsd
+ * \ingroup group_xml
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxExportToXML(vx_context context, vx_char xmlfile[]);
+
+
+/*! \brief Imports all framework and data objects from an XML file into the given context.
+ * \param [in] context The context to import into.
+ * \param [in] xmlfile The XML file to read.
+ * \note The reference indices in the import object corresponds with the reference numbers in the
+ * XML file. It is assumed that the program has some means to know which references to use from
+ * imported list (either by name: <tt>\ref vxGetImportReferenceByName</tt>, or by index from looking at the XML
+ * file (debug use case): <tt>\ref vxGetImportReferenceByIndex</tt>).  Alternativly, the program can use
+ * <tt>\ref vxGetImportReferenceByIndex</tt> in a loop and query each one to understand what was imported. After
+ * all references of interest have been retrieved, this import obects should be released using
+ * <tt>\ref vxReleaseImport</tt>.
+ * \return \ref vx_import object containing references to the imported objects in the context
+ * \see https://www.khronos.org/registry/vx/schema/openvx-1-1.xsd
+ * \ingroup group_xml
+ */
+VX_API_ENTRY vx_import VX_API_CALL vxImportFromXML(vx_context context, vx_char xmlfile[]);
+
+/*! \brief Used to retrieve a reference by name from the import when the name is known beforehand.  If
+ *  multiple references have the same name, then *any* one of them may be returned.
+ * \param [in] import The reference to the import object.
+ * \param [in] name The reference string name.
+ * \return <tt>\ref vx_reference</tt>
+ * \retval 0 Invalid import object or name does not match a reference in the import object.
+ * \retval * The reference matching the requested name.
+ * \note Use <tt>\ref vxReleaseReference</tt> to release the reference before releasing the context.
+ * \pre <tt>\ref vxImportFromXML</tt>
+ * \ingroup group_xml
+ */
+VX_API_ENTRY vx_reference VX_API_CALL vxGetImportReferenceByName(vx_import import, const vx_char *name);
+
+/*! \brief Used to retrieve a reference by the index from the import.
+ * \param [in] import The reference to the import object.
+ * \param [in] index The index of the reference in the import object to return.
+ * \return <tt>\ref vx_reference</tt>
+ * \retval 0 Invalid import object or index.
+ * \retval * The reference at the requested index number.
+ * \note Use <tt>\ref vxQueryImport</tt> with <tt>\ref VX_IMPORT_ATTRIBUTE_COUNT</tt> to retrieve
+ * the upper limit of references in the import.
+ * \note Use <tt>\ref vxReleaseReference</tt> to release the reference before releasing the context.
+ * \pre <tt>\ref vxImportFromXML</tt>
+ * \ingroup group_xml
+ */
+VX_API_ENTRY vx_reference VX_API_CALL vxGetImportReferenceByIndex(vx_import import, vx_uint32 index);
+
+/*! \brief Used to query the import about its properties.
+ * \param [in] import The reference to the import object.
+ * \param [in] attribute The <tt>\ref vx_import_attribute_e</tt> value to query for.
+ * \param [out] ptr The location at which the resulting value will be stored.
+ * \param [in] size The size of the container to which ptr points.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \pre <tt>\ref vxImportFromXML</tt>
+ * \ingroup group_xml
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxQueryImport(vx_import import, vx_enum attribute, void *ptr, vx_size size);
+
+/*! \brief Releases a reference to an import object.
+ * Also internally releases its references to its imported objects. These
+ * imported objects may not be garbage collected until their total reference
+ * counts are zero.
+ * \param [in] import The pointer to the import object to release.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS No errors.
+ * \retval VX_ERROR_INVALID_REFERENCE If import is not a <tt>\ref vx_import</tt>.
+ * \note After returning from this function the reference will be zeroed.
+ * \pre <tt>\ref vxImportFromXML</tt>
+ * \ingroup group_xml
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseImport(vx_import *import);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+

+ 967 - 0
include_bakbak/VX/vx_nodes.h

@@ -0,0 +1,967 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_NODES_H_
+#define _OPENVX_NODES_H_
+
+/*!
+ * \file vx_nodes.h
+ * \brief The "Simple" API interface for OpenVX. These APIs are just
+ * wrappers around the more verbose functions defined in <tt>\ref vx_api.h</tt>.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief [Graph] Creates a color conversion node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image from which to convert.
+ * \param [out] output The output image to which to convert, which must have the same dimensions as the input image.
+ * \see <tt>VX_KERNEL_COLOR_CONVERT</tt>
+ * \ingroup group_vision_function_colorconvert
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxColorConvertNode(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates a channel extract node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image. Must be one of the defined \ref vx_df_image_e multi-channel formats.
+ * \param [in] channel The <tt>\ref vx_channel_e</tt> channel to extract.
+ * \param [out] output The output image. Must be <tt>\ref VX_DF_IMAGE_U8</tt>, and must have the same dimensions as the input image.
+ * <tt>\see VX_KERNEL_CHANNEL_EXTRACT</tt>
+ * \ingroup group_vision_function_channelextract
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxChannelExtractNode(vx_graph graph,
+                             vx_image input,
+                             vx_enum channel,
+                             vx_image output);
+
+/*! \brief [Graph] Creates a channel combine node.
+ * \param [in] graph The graph reference.
+ * \param [in] plane0 The plane that forms channel 0. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] plane1 The plane that forms channel 1. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] plane2 [optional] The plane that forms channel 2. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] plane3 [optional] The plane that forms channel 3. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [out] output The output image. The format of the image must be defined, even if the image is virtual. Must have the same dimensions as the input images
+ * \see <tt>VX_KERNEL_CHANNEL_COMBINE</tt>
+ * \ingroup group_vision_function_channelcombine
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxChannelCombineNode(vx_graph graph,
+                             vx_image plane0,
+                             vx_image plane1,
+                             vx_image plane2,
+                             vx_image plane3,
+                             vx_image output);
+
+/*! \brief [Graph] Creates a Phase node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] grad_x The input x image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] grad_y The input y image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] orientation The phase image. This is in <tt>\ref VX_DF_IMAGE_U8</tt> format, and must have the same dimensions as the input images.
+ * \see <tt>VX_KERNEL_PHASE</tt>
+ * \ingroup group_vision_function_phase
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxPhaseNode(vx_graph graph, vx_image grad_x, vx_image grad_y, vx_image orientation);
+
+/*! \brief [Graph] Creates a Sobel3x3 node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output_x [optional] The output gradient in the x direction in <tt>\ref VX_DF_IMAGE_S16</tt>. Must have the same dimensions as the input image.
+ * \param [out] output_y [optional] The output gradient in the y direction in <tt>\ref VX_DF_IMAGE_S16</tt>. Must have the same dimensions as the input image.
+ * \see <tt>VX_KERNEL_SOBEL_3x3</tt>
+ * \ingroup group_vision_function_sobel3x3
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxSobel3x3Node(vx_graph graph, vx_image input, vx_image output_x, vx_image output_y);
+
+
+/*! \brief [Graph] Create a Magnitude node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] grad_x The input x image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] grad_y The input y image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] mag The magnitude image. This is in <tt>\ref VX_DF_IMAGE_S16</tt> format. Must have the same dimensions as the input image.
+ * \see <tt>VX_KERNEL_MAGNITUDE</tt>
+ * \ingroup group_vision_function_magnitude
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxMagnitudeNode(vx_graph graph, vx_image grad_x, vx_image grad_y, vx_image mag);
+
+/*! \brief [Graph] Creates a Scale Image Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] src The source image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [out] dst The destination image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] type The interpolation type to use. \see vx_interpolation_type_e.
+ * \ingroup group_vision_function_scale_image
+ * \note The destination image must have a defined size and format. The border modes
+ *  <tt>\ref VX_NODE_BORDER</tt> value <tt>\ref VX_BORDER_UNDEFINED</tt>,
+ *  <tt>\ref VX_BORDER_REPLICATE</tt> and <tt>\ref VX_BORDER_CONSTANT</tt> are supported.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxScaleImageNode(vx_graph graph, vx_image src, vx_image dst, vx_enum type);
+
+/*! \brief [Graph] Creates a Table Lookup node. If a value from the input image is not present in the lookup table, the result is undefined.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] lut The LUT which is of type <tt>\ref VX_TYPE_UINT8</tt> if input image is <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_TYPE_INT16</tt> if input image is <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [out] output The output image of the same type and size as the input image.
+ * \ingroup group_vision_function_lut
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTableLookupNode(vx_graph graph, vx_image input, vx_lut lut, vx_image output);
+
+/*! \brief [Graph] Creates a Histogram node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [out] distribution The output distribution.
+ * \ingroup group_vision_function_histogram
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxHistogramNode(vx_graph graph, vx_image input, vx_distribution distribution);
+
+/*! \brief [Graph] Creates a Histogram Equalization node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The grayscale input image in <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [out] output The grayscale output image of type <tt>\ref VX_DF_IMAGE_U8</tt> with equalized brightness and contrast and same size as the input image.
+ * \ingroup group_vision_function_equalize_hist
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxEqualizeHistNode(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates an AbsDiff node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] in1 An input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] in2 An input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_absdiff
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxAbsDiffNode(vx_graph graph, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Graph] Creates a mean value and optionally, a standard deviation node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image. <tt>\ref VX_DF_IMAGE_U8</tt> is supported.
+ * \param [out] mean The <tt>\ref VX_TYPE_FLOAT32</tt> average pixel value.
+ * \param [out] stddev [optional] The <tt>\ref VX_TYPE_FLOAT32</tt> standard deviation of the pixel values.
+ * \ingroup group_vision_function_meanstddev
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxMeanStdDevNode(vx_graph graph, vx_image input, vx_scalar mean, vx_scalar stddev);
+
+/*! \brief [Graph] Creates a Threshold node and returns a reference to it.
+ * \param [in] graph The reference to the graph in which the node is created.
+ * \param [in] input The input image. Only images with format <tt>\ref VX_DF_IMAGE_U8</tt>
+ * and <tt>\ref VX_DF_IMAGE_S16</tt> are supported.
+ * \param [in] thresh The thresholding object that defines the parameters of
+ * the operation. The <tt>\ref VX_THRESHOLD_INPUT_FORMAT</tt> must be the same as the input image format and
+ * the <tt>\ref VX_THRESHOLD_OUTPUT_FORMAT</tt> must be the same as the output image format.
+ * \param [out] output The output image, that will contain as pixel value
+ * true and false values defined by \p thresh. Only images with format
+ * <tt>\ref VX_DF_IMAGE_U8</tt> are supported. The dimensions are the same as the input image.
+ * \ingroup group_vision_function_threshold
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation
+ * should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxThresholdNode(vx_graph graph, vx_image input, vx_threshold thresh, vx_image output);
+
+/*! \brief [Graph] Creates a Non-Maxima Suppression node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] mask [optional] Constrict suppression to a ROI. The mask image is of type <tt>\ref VX_DF_IMAGE_U8</tt> and must be the same dimensions as the input image.
+ * \param [in] win_size The size of window over which to perform the localized non-maxima suppression. Must be odd, and less than or equal to the smallest dimension of the input image.
+ * \param [out] output The output image, of the same type and size as the input, that has been non-maxima suppressed.
+ * \ingroup group_vision_function_nms
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxNonMaxSuppressionNode(vx_graph graph, vx_image input, vx_image mask, vx_int32 win_size, vx_image output);
+
+/*! \brief [Graph] Creates an Integral Image Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U32</tt> format, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_integral_image
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxIntegralImageNode(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates an Erosion Image Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_erode_image
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxErode3x3Node(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates a Dilation Image Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_dilate_image
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxDilate3x3Node(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates a Median Image Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_median_image
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxMedian3x3Node(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates a Box Filter Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_box_image
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxBox3x3Node(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates a Gaussian Filter Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_gaussian_image
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxGaussian3x3Node(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates a Non-linear Filter Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] function The non-linear filter function. See <tt>\ref vx_non_linear_filter_e</tt>.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [in] mask The mask to be applied to the Non-linear function. <tt>\ref VX_MATRIX_ORIGIN</tt> attribute is used
+ *  to place the mask appropriately when computing the resulting image. See <tt>\ref vxCreateMatrixFromPattern</tt>.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format, which must have the same dimensions as the input image.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ * \ingroup group_vision_function_nonlinear_filter
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxNonLinearFilterNode(vx_graph graph, vx_enum function, vx_image input, vx_matrix mask, vx_image output);
+
+/*! \brief [Graph] Creates a custom convolution node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [in] conv The <tt>\ref vx_int16</tt> convolution matrix.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_custom_convolution
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxConvolveNode(vx_graph graph, vx_image input, vx_convolution conv, vx_image output);
+
+/*! \brief [Graph] Creates a node for a Gaussian Image Pyramid.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] gaussian The Gaussian pyramid with <tt>\ref VX_DF_IMAGE_U8</tt> to construct.
+ * \ingroup group_vision_function_gaussian_pyramid
+ * \see group_pyramid
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxGaussianPyramidNode(vx_graph graph, vx_image input, vx_pyramid gaussian);
+
+/*! \brief [Graph] Creates a node for a Laplacian Image Pyramid.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] laplacian The Laplacian pyramid with <tt>\ref VX_DF_IMAGE_S16</tt> to construct.
+ * \param [out] output The lowest resolution image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format necessary to reconstruct the input image from the pyramid. The output image format should be same as input image format.
+ * \ingroup group_vision_function_laplacian_pyramid
+ * \see group_pyramid
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxLaplacianPyramidNode(vx_graph graph, vx_image input,
+                                   vx_pyramid laplacian, vx_image output);
+
+/*! \brief [Graph] Reconstructs an image from a Laplacian Image pyramid.
+ * \param [in] graph The reference to the graph.
+ * \param [in] laplacian The Laplacian pyramid with <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] input The lowest resolution image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format for the Laplacian pyramid.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format with the highest possible resolution reconstructed from the Laplacian pyramid. The output image format should be same as input image format.
+ * \ingroup group_vision_function_laplacian_reconstruct
+ * \see group_pyramid
+ * \return <tt>\ref vx_node</tt>.
+ * \retval 0 Node could not be created.
+ * \retval * Node handle.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxLaplacianReconstructNode(vx_graph graph, vx_pyramid laplacian, vx_image input,
+                                       vx_image output);
+
+/*! \brief [Graph] Creates an accumulate node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in,out] accum The accumulation image in <tt>\ref VX_DF_IMAGE_S16</tt>, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_accumulate
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxAccumulateImageNode(vx_graph graph, vx_image input, vx_image accum);
+
+/*! \brief [Graph] Creates a weighted accumulate node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] alpha The input <tt>\ref VX_TYPE_FLOAT32</tt> scalar value with a value in the range of \f$ 0.0 \le \alpha \le 1.0 \f$.
+ * \param [in,out] accum The <tt>\ref VX_DF_IMAGE_U8</tt> accumulation image, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_accumulate_weighted
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxAccumulateWeightedImageNode(vx_graph graph, vx_image input, vx_scalar alpha, vx_image accum);
+
+/*! \brief [Graph] Creates an accumulate square node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] shift The input <tt>\ref VX_TYPE_UINT32</tt> with a value in the range of \f$ 0 \le shift \le 15 \f$.
+ * \param [in,out] accum The accumulation image in <tt>\ref VX_DF_IMAGE_S16</tt>, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_accumulate_square
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxAccumulateSquareImageNode(vx_graph graph, vx_image input, vx_scalar shift, vx_image accum);
+
+/*! \brief [Graph] Creates a min,max,loc node.
+ * \param [in] graph The reference to create the graph.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] minVal The minimum value in the image, which corresponds to the type of the input.
+ * \param [out] maxVal The maximum value in the image, which corresponds to the type of the input.
+ * \param [out] minLoc [optional] The minimum <tt>\ref VX_TYPE_COORDINATES2D</tt> locations. If the input image has several minimums, the kernel will return up to the capacity of the array.
+ * \param [out] maxLoc [optional] The maximum <tt>\ref VX_TYPE_COORDINATES2D</tt> locations. If the input image has several maximums, the kernel will return up to the capacity of the array.
+ * \param [out] minCount [optional] The total number of detected minimums in image. Use a <tt>\ref VX_TYPE_SIZE</tt> scalar.
+ * \param [out] maxCount [optional] The total number of detected maximums in image. Use a <tt>\ref VX_TYPE_SIZE</tt> scalar.
+ * \ingroup group_vision_function_minmaxloc
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxMinMaxLocNode(vx_graph graph,
+                        vx_image input,
+                        vx_scalar minVal, vx_scalar maxVal,
+                        vx_array minLoc, vx_array maxLoc,
+                        vx_scalar minCount, vx_scalar maxCount);
+
+/*! \brief [Graph] Creates a pixel-wise minimum kernel.
+ * \param [in] graph The reference to the graph where to create the node.
+ * \param [in] in1 The first input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] in2 The second input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [out] out The output image which will hold the result of min and will have the same type and dimensions of the imput images.
+ * \ingroup group_vision_function_min
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxMinNode(vx_graph graph, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Graph] Creates a pixel-wise maximum kernel.
+ * \param [in] graph The reference to the graph where to create the node.
+ * \param [in] in1 The first input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] in2 The second input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [out] out The output image which will hold the result of max and will have the same type and dimensions of the imput images.
+ * \ingroup group_vision_function_max
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxMaxNode(vx_graph graph, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Graph] Creates a bitwise AND node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image.
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image.
+ * \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image, which must have the same dimensions as the input images.
+ * \ingroup group_vision_function_and
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxAndNode(vx_graph graph, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Graph] Creates a bitwise INCLUSIVE OR node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image.
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image.
+ * \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image, which must have the same dimensions as the input images.
+ * \ingroup group_vision_function_or
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxOrNode(vx_graph graph, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Graph] Creates a bitwise EXCLUSIVE OR node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image.
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image.
+ * \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image, which must have the same dimensions as the input images.
+ * \ingroup group_vision_function_xor
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxXorNode(vx_graph graph, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Graph] Creates a bitwise NOT node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input A <tt>\ref VX_DF_IMAGE_U8</tt> input image.
+ * \param [out] output The <tt>\ref VX_DF_IMAGE_U8</tt> output image, which must have the same dimensions as the input image.
+ * \ingroup group_vision_function_not
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxNotNode(vx_graph graph, vx_image input, vx_image output);
+
+/*! \brief [Graph] Creates a scalar operation node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] scalar_operation A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_scalar_operation_e</tt> enumeration.
+ * \param [in] a First scalar operand.
+ * \param [in] b Second scalar operand.
+ * \param [out] output Result of the scalar operation.
+ * \ingroup group_control_flow
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxScalarOperationNode(vx_graph graph, vx_enum scalar_operation, vx_scalar a, vx_scalar b, vx_scalar output);
+
+/*! \brief [Graph] Selects one of two data objects depending on the the value of a condition (boolean scalar), and copies its data into another data object.
+ * \details This node supports predicated execution flow within a graph. All the data objects passed to this kernel shall
+ * have the same object type and meta data. It is important to note that an implementation may optimize away the select and copy when virtual data
+ * objects are used.\n
+ * If there is a kernel node that contribute only into virtual data objects during the graph execution due to certain data path being eliminated by not
+ * taken argument of select node, then the OpenVX implementation guarantees that there will not be any side effects to graph execution and node state.\n
+ * If the path to a select node contains non-virtual objects, user nodes, or  nodes with completion callbacks, then that path may not be "optimized out"
+ * because the callback must be executed and the non-virtual objects must be modified.
+ * \param [in] graph The reference to the graph.
+ * \param [in] condition <tt>\ref VX_TYPE_BOOL</tt> predicate variable.
+ * \param [in] true_value Data object for true.
+ * \param [in] false_value Data object for false.
+ * \param [out] output Output data object.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ * \ingroup group_control_flow
+  */
+VX_API_ENTRY vx_node VX_API_CALL vxSelectNode(vx_graph graph, vx_scalar condition, vx_reference true_value, vx_reference false_value, vx_reference output);
+
+/*! \brief [Graph] Creates an pixelwise-multiplication node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] in1 An input image, <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] in2 An input image, <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] scale A non-negative <tt>\ref VX_TYPE_FLOAT32</tt> multiplied to each product before overflow handling.
+ * \param [in] overflow_policy A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] rounding_policy A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_round_policy_e</tt> enumeration.
+ * \param [out] out The output image, a <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> image. Must have the same type and dimensions of the imput images.
+ * \ingroup group_vision_function_mult
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxMultiplyNode(vx_graph graph,
+                       vx_image in1, vx_image in2,
+                       vx_scalar scale,
+                       vx_enum overflow_policy,
+                       vx_enum rounding_policy,
+                       vx_image out);
+
+/*! \brief [Graph] Creates an arithmetic addition node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] in1 An input image, <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] in2 An input image, <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] policy A <tt>\ref VX_TYPE_ENUM</tt> of the \ref vx_convert_policy_e enumeration.
+ * \param [out] out The output image, a <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> image, which must have the same dimensions as the input images.
+ * \ingroup group_vision_function_add
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxAddNode(vx_graph graph,
+                  vx_image in1, vx_image in2,
+                  vx_enum policy,
+                  vx_image out);
+
+/*! \brief [Graph] Creates an arithmetic subtraction node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] in1 An input image, <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>, the minuend.
+ * \param [in] in2 An input image, <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>, the subtrahend.
+ * \param [in] policy A <tt>\ref VX_TYPE_ENUM</tt> of the \ref vx_convert_policy_e enumeration.
+ * \param [out] out The output image, a <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> image, which must have the same dimensions as the input images.
+ * \ingroup group_vision_function_sub
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxSubtractNode(vx_graph graph,
+                       vx_image in1, vx_image in2,
+                       vx_enum policy,
+                       vx_image out);
+
+/*! \brief [Graph] Creates a bit-depth conversion node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image.
+ * \param [out] output The output image with the same dimensions of the input image.
+ * \param [in] policy A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] shift A scalar containing a <tt>\ref VX_TYPE_INT32</tt> of the shift value.
+ * \ingroup group_vision_function_convertdepth
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxConvertDepthNode(vx_graph graph, vx_image input, vx_image output, vx_enum policy, vx_scalar shift);
+
+/*! \brief [Graph] Creates a Canny Edge Detection Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] hyst The double threshold for hysteresis. The <tt>\ref VX_THRESHOLD_INPUT_FORMAT</tt> shall be either
+ * <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>. The <tt>\ref VX_THRESHOLD_OUTPUT_FORMAT</tt> is ignored.
+ * \param [in] gradient_size The size of the Sobel filter window, must support at least 3, 5, and 7.
+ * \param [in] norm_type A flag indicating the norm used to compute the gradient, <tt>\ref VX_NORM_L1</tt> or <tt>\ref VX_NORM_L2</tt>.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format with values either 0 or 255.
+ * \ingroup group_vision_function_canny
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxCannyEdgeDetectorNode(vx_graph graph, vx_image input, vx_threshold hyst,
+                                vx_int32 gradient_size, vx_enum norm_type,
+                                vx_image output);
+
+/*! \brief [Graph] Creates an Affine Warp Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] matrix The affine matrix. Must be 2x3 of type \ref VX_TYPE_FLOAT32.
+ * \param [in] type The interpolation type from <tt>\ref vx_interpolation_type_e</tt>.
+ * <tt>\ref VX_INTERPOLATION_AREA</tt> is not supported.
+ * \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image and the same dimensions as the input image.
+ * \ingroup group_vision_function_warp_affine
+ * \note The border modes <tt>\ref VX_NODE_BORDER</tt> value <tt>\ref VX_BORDER_UNDEFINED</tt> and
+ * <tt>\ref VX_BORDER_CONSTANT</tt> are supported.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxWarpAffineNode(vx_graph graph, vx_image input, vx_matrix matrix, vx_enum type, vx_image output);
+
+/*! \brief [Graph] Creates a Perspective Warp Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] matrix The perspective matrix. Must be 3x3 of type <tt>\ref VX_TYPE_FLOAT32</tt>.
+ * \param [in] type The interpolation type from <tt>\ref vx_interpolation_type_e</tt>.
+ * <tt>\ref VX_INTERPOLATION_AREA</tt> is not supported.
+ * \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image with the same dimensions as the input image.
+ * \ingroup group_vision_function_warp_perspective
+ * \note The border modes <tt>\ref VX_NODE_BORDER</tt> value <tt>\ref VX_BORDER_UNDEFINED</tt> and
+ * <tt>\ref VX_BORDER_CONSTANT</tt> are supported.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxWarpPerspectiveNode(vx_graph graph, vx_image input, vx_matrix matrix, vx_enum type, vx_image output);
+
+/*! \brief [Graph] Creates a Harris Corners Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] strength_thresh The <tt>\ref VX_TYPE_FLOAT32</tt> minimum threshold with which to eliminate Harris Corner scores (computed using the normalized Sobel kernel).
+ * \param [in] min_distance The <tt>\ref VX_TYPE_FLOAT32</tt> radial Euclidean distance for non-maximum suppression.
+ * \param [in] sensitivity The <tt>\ref VX_TYPE_FLOAT32</tt> scalar sensitivity threshold \f$ k \f$ from the Harris-Stephens equation.
+ * \param [in] gradient_size The gradient window size to use on the input. The
+ * implementation must support at least 3, 5, and 7.
+ * \param [in] block_size The block window size used to compute the Harris Corner score.
+ * The implementation must support at least 3, 5, and 7.
+ * \param [out] corners The array of <tt>\ref VX_TYPE_KEYPOINT</tt> objects. The order of the keypoints in this array is implementation dependent.
+ * \param [out] num_corners [optional] The total number of detected corners in image. Use a \ref VX_TYPE_SIZE scalar.
+ * \ingroup group_vision_function_harris
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxHarrisCornersNode(vx_graph graph,
+                            vx_image input,
+                            vx_scalar strength_thresh,
+                            vx_scalar min_distance,
+                            vx_scalar sensitivity,
+                            vx_int32 gradient_size,
+                            vx_int32 block_size,
+                            vx_array corners,
+                            vx_scalar num_corners);
+
+/*! \brief [Graph] Creates a FAST Corners Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] strength_thresh Threshold on difference between intensity of the central pixel and pixels on Bresenham's circle
+ * of radius 3 (<tt>\ref VX_TYPE_FLOAT32</tt> scalar), with a value in the range of 0.0 \f$\le\f$ strength_thresh < 256.0.
+ *  Any fractional value will be truncated to an integer.
+ * \param [in] nonmax_suppression If true, non-maximum suppression is applied to
+ * detected corners before being placed in the <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt> objects.
+ * \param [out] corners Output corner <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt>. The order of the
+ *                      keypoints in this array is implementation dependent.
+ * \param [out] num_corners [optional] The total number of detected corners in image. Use a \ref VX_TYPE_SIZE scalar.
+ * \ingroup group_vision_function_fast
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxFastCornersNode(vx_graph graph, vx_image input, vx_scalar strength_thresh, vx_bool nonmax_suppression, vx_array corners, vx_scalar num_corners);
+
+/*! \brief [Graph] Creates a Lucas Kanade Tracking Node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] old_images Input of first (old) image pyramid in <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] new_images Input of destination (new) image pyramid <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] old_points An array of key points in a <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt>; those key points are defined at
+ *  the \a old_images high resolution pyramid.
+ * \param [in] new_points_estimates An array of estimation on what is the output key points in a <tt>\ref vx_array</tt> of
+ *  <tt>\ref VX_TYPE_KEYPOINT</tt>; those keypoints are defined at the \a new_images high resolution pyramid.
+ * \param [out] new_points An output array of key points in a <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt>; those key points are
+ *  defined at the \a new_images high resolution pyramid.
+ * \param [in] termination The termination can be <tt>\ref VX_TERM_CRITERIA_ITERATIONS</tt> or <tt>\ref VX_TERM_CRITERIA_EPSILON</tt> or
+ * <tt>\ref VX_TERM_CRITERIA_BOTH</tt>.
+ * \param [in] epsilon The <tt>\ref vx_float32</tt> error for terminating the algorithm.
+ * \param [in] num_iterations The number of iterations. Use a <tt>\ref VX_TYPE_UINT32</tt> scalar.
+ * \param [in] use_initial_estimate Use a <tt>\ref VX_TYPE_BOOL</tt> scalar.
+ * \param [in] window_dimension The size of the window on which to perform the algorithm. See
+ *  <tt>\ref VX_CONTEXT_OPTICAL_FLOW_MAX_WINDOW_DIMENSION</tt>
+ * \ingroup group_vision_function_opticalflowpyrlk
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxOpticalFlowPyrLKNode(vx_graph graph,
+                               vx_pyramid old_images,
+                               vx_pyramid new_images,
+                               vx_array old_points,
+                               vx_array new_points_estimates,
+                               vx_array new_points,
+                               vx_enum termination,
+                               vx_scalar epsilon,
+                               vx_scalar num_iterations,
+                               vx_scalar use_initial_estimate,
+                               vx_size window_dimension);
+
+/*! \brief [Graph] Creates a Remap Node.
+ * \param [in] graph The reference to the graph that will contain the node.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] table The remap table object.
+ * \param [in] policy An interpolation type from <tt>\ref vx_interpolation_type_e</tt>.
+ * <tt>\ref VX_INTERPOLATION_AREA</tt> is not supported.
+ * \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image with the same dimensions as the input image.
+ * \note The border modes <tt>\ref VX_NODE_BORDER</tt> value <tt>\ref VX_BORDER_UNDEFINED</tt> and
+ * <tt>\ref VX_BORDER_CONSTANT</tt> are supported.
+ * \return A <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ * \ingroup group_vision_function_remap
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxRemapNode(vx_graph graph,
+                    vx_image input,
+                    vx_remap table,
+                    vx_enum policy,
+                    vx_image output);
+
+/*! \brief [Graph] Performs a Gaussian Blur on an image then half-scales it. The interpolation mode used is nearest-neighbor.
+ * \details The output image size is determined by:
+ * \f[
+ * W_{output} = \frac{W_{input} + 1}{2} \\
+ * ,
+ * H_{output} = \frac{H_{input} + 1}{2}
+ * \f]
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] kernel_size The input size of the Gaussian filter. Supported values are 1, 3 and 5.
+ * \ingroup group_vision_function_scale_image
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxHalfScaleGaussianNode(vx_graph graph, vx_image input, vx_image output, vx_int32 kernel_size);
+
+/*! \brief [Graph]  The Node Compares an image template against overlapped image regions.
+ * \details The detailed equation to the matching can be found in <tt>\ref vx_comp_metric_e</tt>.
+ * The output of the template matching node is a comparison map as described in <tt>\ref vx_comp_metric_e</tt>.
+ * The Node have a limitation on the template image size (width*height). It should not be larger then 65535.
+ * If the valid region of the template image is smaller than the entire template image, the result in the destination image is implementation-dependent.
+ * \param [in] graph The reference to the graph.
+ * \param [in] src The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] templateImage Searched template of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] matchingMethod attribute specifying the comparison method <tt>\ref vx_comp_metric_e</tt>. This function support only <tt>\ref VX_COMPARE_CCORR_NORM</tt> and <tt>\ref VX_COMPARE_L2</tt>.
+ * \param [out] output Map of comparison results. The output is an image of type VX_DF_IMAGE_S16
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ * \ingroup group_vision_function_match_template
+ */
+ VX_API_ENTRY vx_node VX_API_CALL vxMatchTemplateNode(vx_graph graph, vx_image src, vx_image templateImage, vx_enum matchingMethod, vx_image output);
+
+ /*! \brief [Graph] Creates a node that extracts LBP image from an input image
+* \param [in] graph	The reference to the graph.
+* \param [in] in		An input image in <tt>vx_image</tt>. Or \f$ SrcImg\f$ in the equations. the image is of type <tt>\ref VX_DF_IMAGE_U8</tt>
+* \param [in] format	A variation of LBP like original LBP and mLBP. see <tt> \ref vx_lbp_format_e </tt>
+* \param [in] kernel_size Kernel size. Only size of 3 and 5 are supported
+* \param [out] out	An output image in <tt>vx_image</tt>.Or \f$ DstImg\f$ in the equations. the image is of type <tt>\ref VX_DF_IMAGE_U8</tt> with the same dimensions as the input image.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+* \ingroup group_vision_function_lbp
+*/
+VX_API_ENTRY vx_node VX_API_CALL vxLBPNode(vx_graph graph, vx_image in, vx_enum format, vx_int8 kernel_size, vx_image out);
+
+/*! \brief [Graph] Performs cell calculations for the average gradient magnitude and gradient orientation histograms.
+ * \details Firstly, the gradient magnitude and gradient orientation are computed for each pixel in the input image.
+ * Two 1-D centred, point discrete derivative masks are applied to the input image in the horizontal and vertical directions.
+ * \f[ M_h = [-1, 0, 1] \f] and \f[ M_v = [-1, 0, 1]^T \f]
+ * \f$G_v\f$ is the result of applying mask \f$M_v\f$ to the input image, and \f$G_h\f$ is the result of applying mask \f$M_h\f$ to the input image.
+ * The border mode used for the gradient calculation is implementation dependent. Its behavior should be similar to <tt>\ref VX_BORDER_UNDEFINED</tt>.
+ * The gradient magnitudes and gradient orientations for each pixel are then calculated in the following manner.
+ * \f[ G(x,y) = \sqrt{G_v(x,y)^2 + G_h(x,y)^2} \f]
+ * \f[ \theta(x,y) = arctan(G_v(x,y), G_h(x,y)) \f]
+ * where \f$arctan(v, h)\f$
+ * is \f$ tan^{-1}(v/h)\f$ when \f$h!=0\f$,
+ *
+ * \f$ -pi/2 \f$ if \f$v<0\f$ and \f$h==0\f$,
+ *
+ * \f$  pi/2  \f$ if \f$v>0\f$ and \f$h==0\f$
+ *
+ * and \f$     0  \f$ if \f$v==0\f$ and \f$h==0\f$
+ *
+ * Secondly, the gradient magnitudes and orientations are used to compute the bins output tensor and optional magnitudes output tensor.
+ * These tensors are computed on a cell level where the cells are rectangular in shape.
+ * The magnitudes tensor contains the average gradient magnitude for each cell.
+ * \f[magnitudes(c) = \frac{1}{(cell\_width * cell\_height)}\sum\limits_{w=0}^{cell\_width} \sum\limits_{h=0}^{cell\_height} G_c(w,h)\f]
+ * where \f$G_c\f$ is the gradient magnitudes related to cell \f$c\f$.
+ * The bins tensor contains histograms of gradient orientations for each cell.
+ * The gradient orientations at each pixel range from 0 to 360 degrees.  These are quantised into a set of histogram bins based on the num_bins parameter.
+ * Each pixel votes for a specific cell histogram bin based on its gradient orientation.  The vote itself is the pixel's gradient magnitude.
+ * \f[bins(c, n) = \sum\limits_{w=0}^{cell\_width} \sum\limits_{h=0}^{cell\_height} G_c(w,h) * 1[B_c(w, h, num\_bins) == n]\f]
+ * where \f$B_c\f$ produces the histogram bin number based on the gradient orientation of the pixel at location (\f$w\f$, \f$h\f$) in cell \f$c\f$ based on
+ * the \f$num\_bins\f$ and \f[1[B_c(w, h, num\_bins) == n]\f] is a delta-function with value 1 when \f$B_c(w, h, num\_bins) == n\f$ or 0 otherwise.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] cell_width The histogram cell width of type <tt>\ref VX_TYPE_INT32</tt>.
+ * \param [in] cell_height The histogram cell height of type <tt>\ref VX_TYPE_INT32</tt>.
+ * \param [in] num_bins  The histogram size of type <tt>\ref VX_TYPE_INT32</tt>.
+ * \param [out] magnitudes (Optional) The output average gradient magnitudes per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt> of size \f$ [floor(image_{width}/cell_{width}) ,floor(image_{height}/cell_{height}) ] \f$.
+ * \param [out] bins       The output gradient orientation histograms per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt> of size \f$ [floor(image_{width}/cell_{width}) ,floor(image_{height}/cell_{height}), num_{bins}] \f$.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval 0 Node could not be created.
+ * \retval * Node handle.
+ * \ingroup group_vision_function_hog
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxHOGCellsNode(vx_graph graph, vx_image input, vx_int32 cell_width, vx_int32 cell_height, vx_int32 num_bins, vx_tensor magnitudes, vx_tensor bins);
+
+/*! \brief [Graph] The node produces HOG features for the W1xW2 window in a sliding window fashion over the whole input image. Each position produces a HOG feature vector.
+ * \details Firstly if a magnitudes tensor is provided the cell histograms in the bins tensor are normalised by the average cell gradient magnitudes.
+ \f[bins(c,n) = \frac{bins(c,n)}{magnitudes(c)}\f]
+ * To account for changes in illumination and contrast the cell histograms must be locally normalized which requires grouping the cell histograms together into larger spatially connected blocks.
+ * Blocks are rectangular grids represented by three parameters: the number of cells per block, the number of pixels per cell, and the number of bins per cell histogram.
+ * These blocks typically overlap, meaning that each cell histogram contributes more than once to the final descriptor.
+ * To normalize a block its cell histograms \f$h\f$ are grouped together to form a vector \f$v = [h_1, h_2, h_3, ... , h_n]\f$.
+ * This vector is normalised using L2-Hys which means performing L2-norm on this vector; clipping the result (by limiting the maximum values of v to be threshold) and renormalizing again. If the threshold is equal to zero then L2-Hys normalization is not performed.
+ * \f[L2norm(v) = \frac{v}{\sqrt{\|v\|_2^2 + \epsilon^2}}\f]
+ * where \f$ \|v\|_k \f$ be its k-norm for k=1, 2, and \f$ \epsilon \f$ be a small constant.
+ * For a specific window its HOG descriptor is then the concatenated vector of the components of the normalized cell histograms from all of the block regions contained in the window.
+ * The W1xW2 window starting position is at coordinates 0x0.
+ * If the input image has dimensions that are not an integer multiple of W1xW2 blocks with the specified stride, then the last positions that contain only a partial W1xW2 window
+ * will be calculated with the remaining part of the W1xW2 window padded with zeroes.
+ * The Window W1xW2 must also have a size so that it contains an integer number of cells, otherwise the node is not well-defined.
+ * The final output tensor will contain HOG descriptors equal to the number of windows in the input image.
+ * The output features tensor has 3 dimensions, given by:\n
+ * \f[[ (floor((image_{width}-window_{width})/window_{stride}) + 1),\f]
+ * \f[ (floor((image_{height}-window_{height})/window_{stride}) + 1),\f]
+ * \f[ floor((window_{width} - block_{width})/block_{stride} + 1) * floor((window_{height} - block_{height})/block_{stride} + 1) *\f]
+ * \f[ (((block_{width} * block_{height}) / (cell_{width} * cell_{height})) * num_{bins})] \f]
+ * See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * We recommend the output tensors always be *virtual* objects, with this node connected directly to the classifier.
+ * The output tensor will be very large, and using non-virtual tensors will result in a poorly optimized implementation.
+ * Merging of this node with a classifier node such as that described in the classifier extension will result in better performance.
+ * Notice that this node creation function has more parameters than the corresponding kernel. Numbering of kernel parameters (required if you create this node using the generic interface) is explicitly specified here.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>. (Kernel parameter #0)
+ * \param [in] magnitudes (Optional) The gradient magnitudes per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>. It is the output of <tt>\ref vxHOGCellsNode</tt>.  (Kernel parameter #1)
+ * \param [in] bins       The gradient orientation histograms per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>. It is the output of <tt>\ref vxHOGCellsNode</tt>. (Kernel parameter #2)
+ * \param [in] params The parameters of type <tt>\ref vx_hog_t</tt>.  (Kernel parameter #3)
+ * \param [in] hog_param_size Size of <tt>\ref vx_hog_t</tt> in bytes. Note that this parameter is not counted as one of the kernel parameters.
+ * \param [out] features The output HOG features of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>.  (Kernel parameter #4)
+ * \return <tt>\ref vx_node</tt>.
+ * \retval 0 Node could not be created.
+ * \retval * Node handle.
+ * \ingroup group_vision_function_hog
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxHOGFeaturesNode(vx_graph graph, vx_image input, vx_tensor magnitudes, vx_tensor bins, const vx_hog_t *params, vx_size hog_param_size, vx_tensor features);
+
+/*! \brief [Graph] Finds the Probabilistic Hough Lines detected in the input binary image, each line is stored in the output array as a set of points (x1, y1, x2, y2) .
+ * \details Some implementations of the algorithm may have a random or non-deterministic element. If the target application is in a safety-critical environment this
+ * should be borne in mind and steps taken in the implementation, the application or both to achieve the level of determinism required by the system design.
+ * \param [in] graph graph handle
+ * \param [in] input 8 bit, single channel binary source image
+ * \param [in] params parameters of the struct <tt>\ref vx_hough_lines_p_t</tt>
+ * \param [out] lines_array lines_array contains array of lines, see <tt>\ref vx_line2d_t</tt> The order of lines in implementation dependent
+ * \param [out] num_lines [optional] The total number of detected lines in image. Use a VX_TYPE_SIZE scalar
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ * \ingroup group_vision_function_hough_lines_p
+  */
+VX_API_ENTRY vx_node VX_API_CALL vxHoughLinesPNode(vx_graph graph, vx_image input, const vx_hough_lines_p_t *params, vx_array lines_array, vx_scalar num_lines);
+
+/*! \brief [Graph] The function applies bilateral filtering to the input tensor.
+* \param [in] graph The reference to the graph.
+* \param [in] src The input data a <tt>\ref vx_tensor</tt>. maximum 3 dimension and minimum 2. The tensor is of type <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT16</tt>.
+* dimensions are [radiometric ,width,height] or [width,height].See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+* \param [in] diameter of each pixel neighbourhood that is used during filtering. Values of diameter must be odd. Bigger then 3 and smaller then 10.
+* \param [in] sigmaValues Filter sigma in the radiometric space. Supported values are bigger then 0 and smaller or equal 20.
+* \param [in] sigmaSpace Filter sigma in the spatial space. Supported values are bigger then 0 and smaller or equal 20.
+* \param [out] dst The output data a <tt>\ref vx_tensor</tt>,Of type <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT16</tt>. And must be the same type and size of the input.
+* \note The border modes
+*  <tt>\ref VX_NODE_BORDER</tt> value
+*  <tt>\ref VX_BORDER_REPLICATE</tt> and <tt>\ref VX_BORDER_CONSTANT</tt> are supported.
+* \return <tt>vx_node</tt>.
+* \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>vxGetStatus</tt>
+* \ingroup group_vision_function_bilateral_filter
+*/
+VX_API_ENTRY vx_node VX_API_CALL vxBilateralFilterNode(vx_graph graph, vx_tensor src, vx_int32 diameter, vx_float32 sigmaSpace, vx_float32 sigmaValues, vx_tensor dst);
+
+/*! \brief [Graph] Performs element wise multiplications on element values in the input tensor data with a scale.
+ * \param [in] graph The handle to the graph.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
+ * The data type must match the data type of Input1.
+ * \param [in] scale A non-negative <tt>\ref VX_TYPE_FLOAT32</tt> multiplied to each product before overflow handling.
+ * \param [in] overflow_policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] rounding_policy A <tt>\ref vx_round_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_multiply
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorMultiplyNode(vx_graph graph, vx_tensor input1, vx_tensor input2, vx_scalar scale, vx_enum overflow_policy,
+        vx_enum rounding_policy, vx_tensor output);
+
+/*! \brief [Graph] Performs arithmetic addition on element values in the input tensor data.
+ * \param [in] graph The handle to the graph.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
+ * The data type must match the data type of Input1.
+ * \param [in] policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_add
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorAddNode(vx_graph graph, vx_tensor input1, vx_tensor input2, vx_enum policy, vx_tensor output);
+
+/*! \brief [Graph] Performs arithmetic subtraction on element values in the input tensor data.
+ * \param [in] graph The handle to the graph.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal
+ * The data type must match the data type of Input1.
+ * \param [in] policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_subtract
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorSubtractNode(vx_graph graph, vx_tensor input1, vx_tensor input2, vx_enum policy, vx_tensor output);
+
+/*! \brief [Graph] Performs LUT on element values in the input tensor data.
+ * \param [in] graph The handle to the graph.
+ * \param [in] input1 Input tensor data. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt>, with fixed_point_position 0.
+ * \param [in] lut The look-up table to use, of type <tt>\ref vx_lut</tt>.
+ * The elements of input1 are treated as unsigned integers to determine an index into the look-up table.
+ * The data type of the items in the look-up table must match that of the output tensor.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_tablelookup
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorTableLookupNode(vx_graph graph, vx_tensor input1, vx_lut lut, vx_tensor output);
+
+/*! \brief [Graph] Performs transpose on the input tensor.
+ * The node transpose the tensor according to a specified 2 indexes in the tensor (0-based indexing)
+ * \param [in] graph The handle to the graph.
+ * \param [in] input Input tensor data, Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [out] output output tensor data,
+ * \param [in] dimension1 Dimension index that is transposed with dim 2.
+ * \param [in] dimension2 Dimension index that is transposed with dim 1.
+ * \ingroup group_vision_function_tensor_transpose
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorTransposeNode(vx_graph graph, vx_tensor input, vx_tensor output, vx_size dimension1, vx_size dimension2);
+/*! \brief [Graph] Creates a bit-depth conversion node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input tensor. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [in] policy A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] norm A scalar containing a <tt>\ref VX_TYPE_FLOAT32</tt> of the normalization value.
+ * \param [in] offset A scalar containing a <tt>\ref VX_TYPE_FLOAT32</tt> of the offset value subtracted before normalization.
+ * \param [out] output The output tensor. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt>. with fixed_point_position 8.
+ * And <tt>\ref VX_TYPE_UINT8</tt> with fixed_point_position 0.
+ * \ingroup group_vision_function_tensor_convert_depth
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorConvertDepthNode(vx_graph graph, vx_tensor input, vx_enum policy, vx_scalar norm, vx_scalar offset, vx_tensor output);
+
+/*! \brief [Graph] Creates a generalized matrix multiplication node.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input1 The first input 2D tensor of type <tt>\ref  VX_TYPE_INT16</tt> with fixed_point_pos 8, or tensor data types <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_pos 0.
+ * \param [in] input2 The second 2D tensor. Must be in the same data type as input1.
+ * \param [in] input3 The third 2D tensor. Must be in the same data type as input1. [optional].
+ * \param [in] matrix_multiply_params Matrix multiply parameters, see <tt>\ref vx_tensor_matrix_multiply_params_t </tt>.
+ * \param [out] output The output 2D tensor. Must be in the same data type as input1. Output dimension must agree the formula in the description.
+ * \ingroup group_vision_function_tensor_matrix_multiply
+ * \return <tt>\ref vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxTensorMatrixMultiplyNode(vx_graph graph, vx_tensor input1, vx_tensor input2, vx_tensor input3,
+    const vx_tensor_matrix_multiply_params_t *matrix_multiply_params, vx_tensor output);
+
+/*! \brief Copy data from one object to another.
+ * \note An implementation may optimize away the copy when virtual data objects are used.
+ * \param [in] graph The reference to the graph.
+ * \param [in] input The input data object.
+ * \param [out] output The output data object with meta-data identical to the input data object.
+ * \return <tt>\ref vx_node</tt>.
+ * \retval vx_node A node reference. Any possible errors preventing a successful creation
+ * should be checked using <tt>\ref vxGetStatus</tt>
+ * \ingroup group_vision_function_copy
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxCopyNode(vx_graph graph, vx_reference input, vx_reference output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 1891 - 0
include_bakbak/VX/vx_types.h

@@ -0,0 +1,1891 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_TYPES_H_
+#define _OPENVX_TYPES_H_
+
+/*!
+ * \file vx_types.h
+ * \brief The type definitions required by OpenVX Library.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+
+/*!
+ * \internal
+ * \def VX_API_ENTRY
+ * \brief This is a tag used to identify exported, public API functions as
+ * distinct from internal functions, helpers, and other non-public interfaces.
+ * It can optionally be defined in the make system according the the compiler and intent.
+ * \ingroup group_basic_features
+ */
+
+/*!
+ * \def VX_API_CALL
+ * \brief Defines calling convention for OpenVX API.
+ * \ingroup group_basic_features
+ */
+
+/*!
+ * \def VX_CALLBACK
+ * \brief Defines calling convention for user callbacks.
+ * \ingroup group_basic_features
+ */
+
+#ifndef VX_API_ENTRY
+#if defined(_WIN32)
+#define VX_API_ENTRY __declspec(dllexport)
+#define VX_API_DEPRECATED __declspec(deprecated)
+#else
+#define VX_API_ENTRY __attribute((visibility("default")))
+#define VX_API_DEPRECATED __attribute((deprecated))
+#endif
+#endif
+#ifndef VX_API_CALL
+#if defined(_WIN32)
+#define VX_API_CALL __stdcall
+#else
+#define VX_API_CALL
+#endif
+#endif
+#ifndef VX_CALLBACK
+#if defined(_WIN32)
+#define VX_CALLBACK __stdcall
+#else
+#define VX_CALLBACK
+#endif
+#endif
+
+/*! \brief An 8 bit ASCII character.
+ * \ingroup group_basic_features
+ */
+typedef char     vx_char;
+
+/*! \brief An 8-bit unsigned value.
+ * \ingroup group_basic_features
+ */
+typedef uint8_t  vx_uint8;
+
+/*! \brief A 16-bit unsigned value.
+ * \ingroup group_basic_features
+ */
+typedef uint16_t vx_uint16;
+
+/*! \brief A 32-bit unsigned value.
+ * \ingroup group_basic_features
+ */
+typedef uint32_t vx_uint32;
+
+/*! \brief A 64-bit unsigned value.
+ * \ingroup group_basic_features
+ */
+typedef uint64_t vx_uint64;
+
+/*! \brief An 8-bit signed value.
+ * \ingroup group_basic_features
+ */
+typedef int8_t   vx_int8;
+
+/*! \brief A 16-bit signed value.
+ * \ingroup group_basic_features
+ */
+typedef int16_t  vx_int16;
+
+/*! \brief A 32-bit signed value.
+ * \ingroup group_basic_features
+ */
+typedef int32_t  vx_int32;
+
+/*! \brief A 64-bit signed value.
+ * \ingroup group_basic_features
+ */
+typedef int64_t  vx_int64;
+
+typedef uint32_t vx_bitfield;
+
+#if defined(EXPERIMENTAL_PLATFORM_SUPPORTS_16_FLOAT)
+
+/*! \brief A 16-bit float value.
+ * \ingroup group_basic_features
+ */
+typedef hfloat   vx_float16;
+#endif
+
+/*! \brief A 32-bit float value.
+ * \ingroup group_basic_features
+ */
+typedef float    vx_float32;
+
+/*! \brief A 64-bit float value (aka double).
+ * \ingroup group_basic_features
+ */
+typedef double   vx_float64;
+
+/*! \brief A generic opaque reference to any object within OpenVX.
+ * \details A user of OpenVX should not assume that this can be cast directly to anything;
+ * however, any object in OpenVX can be cast back to this for the purposes of
+ * querying attributes of the object or for passing the object as a parameter to
+ * functions that take a <tt>\ref vx_reference</tt> type.
+ * If the API does not take that specific type but may take others, an
+ * error may be returned from the API.
+ * \ingroup group_reference
+ */
+typedef struct _vx_reference *vx_reference;
+
+/*! \brief Sets the standard enumeration type size to be a fixed quantity.
+ * \details All enumerable fields must use this type as the container to
+ * enforce enumeration ranges and sizeof() operations.
+ * \ingroup group_basic_features
+ */
+typedef int32_t vx_enum;
+
+/*! \brief A wrapper of <tt>size_t</tt> to keep the naming convention uniform.
+ * \ingroup group_basic_features
+ */
+typedef size_t vx_size;
+
+/*! \brief Used to hold a VX_DF_IMAGE code to describe the pixel format and color space.
+ * \ingroup group_basic_features
+ */
+typedef uint32_t vx_df_image;
+
+/*! \brief Holds the address of a variable where the map/unmap functions return a map identifier.
+ * \ingroup group_image
+ */
+typedef uintptr_t vx_map_id;
+
+/*! \brief An opaque reference to a scalar.
+ * \details A scalar can be up to 64 bits wide.
+ * \see vxCreateScalar
+ * \ingroup group_scalar
+ * \extends vx_reference
+ */
+typedef struct _vx_scalar *vx_scalar;
+
+/*! \brief An opaque reference to an image.
+ * \see vxCreateImage
+ * \ingroup group_image
+ * \extends vx_reference
+ */
+typedef struct _vx_image *vx_image;
+
+/*! \brief An opaque reference to the descriptor of a kernel.
+ * \see vxGetKernelByName
+ * \see vxGetKernelByEnum
+ * \ingroup group_kernel
+ * \extends vx_reference
+ */
+typedef struct _vx_kernel *vx_kernel;
+
+/*! \brief An opaque reference to a single parameter.
+ * \see vxGetParameterByIndex
+ * \ingroup group_parameter
+ * \extends vx_reference
+ */
+typedef struct _vx_parameter *vx_parameter;
+
+/*! \brief An opaque reference to a kernel node.
+ * \see vxCreateGenericNode
+ * \ingroup group_node
+ * \extends vx_reference
+ */
+typedef struct _vx_node *vx_node;
+
+/*! \brief An opaque reference to a graph
+ * \see vxCreateGraph
+ * \ingroup group_graph
+ * \extends vx_reference
+ */
+typedef struct _vx_graph *vx_graph;
+
+/*! \brief An opaque reference to the implementation context.
+ * \see vxCreateContext
+ * \ingroup group_context
+ * \extends vx_reference
+ */
+typedef struct _vx_context *vx_context;
+
+/*! \brief The delay object. This is like a ring buffer of objects that is
+ * maintained by the OpenVX implementation.
+ * \see vxCreateDelay
+ * \extends vx_reference
+ * \ingroup group_delay
+ */
+typedef struct _vx_delay *vx_delay;
+
+/*! \brief The Look-Up Table (LUT) Object.
+ * \extends vx_reference
+ * \ingroup group_lut
+ */
+typedef struct _vx_lut *vx_lut;
+
+/*! \brief The Distribution object. This has a user-defined number of bins over
+ * a user-defined range (within a uint32_t range).
+ * \extends vx_reference
+ * \ingroup group_distribution
+ */
+typedef struct _vx_distribution *vx_distribution;
+
+/*! \brief The Matrix Object. An MxN matrix of some unit type.
+ * \extends vx_reference
+ * \ingroup group_matrix
+ */
+typedef struct _vx_matrix *vx_matrix;
+
+/*! \brief The Image Pyramid object. A set of scaled images.
+ * \extends vx_reference
+ * \ingroup group_pyramid
+ */
+typedef struct _vx_pyramid *vx_pyramid;
+
+/*! \brief The Threshold Object. A thresholding object contains the types and
+ * limit values of the thresholding required.
+ * \extends vx_reference
+ * \ingroup group_threshold
+ */
+typedef struct _vx_threshold *vx_threshold;
+
+/*! \brief The Convolution Object. A user-defined convolution kernel of MxM elements.
+ * \extends vx_reference
+ * \ingroup group_convolution
+ */
+typedef struct _vx_convolution *vx_convolution;
+
+/*! \brief The remap table Object. A remap table contains per-pixel mapping of
+ * output pixels to input pixels.
+ * \ingroup group_remap
+ */
+typedef struct _vx_remap *vx_remap;
+
+/*! \brief The Array Object. Array is a strongly-typed container for other data structures.
+ * \ingroup group_array
+ */
+typedef struct _vx_array *vx_array;
+
+/*! \brief The ObjectArray Object. ObjectArray is a strongly-typed container of OpenVX data-objects.
+ * \ingroup group_object_array
+ */
+typedef struct _vx_object_array *vx_object_array;
+
+ /*! \brief The multidimensional data object (Tensor).
+ * \see vxCreateTensor
+ * \ingroup group_object_tensor
+ * \extends vx_reference
+ */
+typedef struct _vx_tensor_t * vx_tensor;
+
+
+
+/*! \brief A Boolean value.
+ * This allows 0 to be FALSE, as it is in C, and any non-zero to be TRUE.
+ * \code
+ * vx_bool ret = vx_true_e;
+ * if (ret) printf("true!\n");
+ * ret = vx_false_e;
+ * if (!ret) printf("false!\n");
+ * \endcode
+ * This would print both strings.
+ * \see vx_bool
+ * \ingroup group_basic_features
+ */
+typedef enum _vx_bool_e {
+    /*! \brief The "false" value. */
+    vx_false_e = 0,
+    /*! \brief The "true" value. */
+    vx_true_e,
+} vx_bool_e;
+
+/*! \brief A formal boolean type with known fixed size.
+ * \see vx_bool_e
+ * \ingroup group_basic_features
+ */
+typedef vx_enum vx_bool;
+
+/*!
+ * \brief This object is used by output validation functions to specify the meta data
+ * of the expected output data object.
+ * \note When the actual output object of the user node is virtual, the information
+ * given through the vx_meta_format object allows the OpenVX framework to automatically
+ * create the data object when meta data were not specified by the application at object
+ * creation time.
+ * \ingroup group_user_kernels
+ */
+typedef struct _vx_meta_format* vx_meta_format;
+
+/*! \brief The type enumeration lists all the known types in OpenVX.
+ * \ingroup group_basic_features
+ */
+enum vx_type_e {
+    VX_TYPE_INVALID         = 0x000,/*!< \brief An invalid type value. When passed an error must be returned. */
+    VX_TYPE_CHAR            = 0x001,/*!< \brief A <tt>\ref vx_char</tt>. */
+    VX_TYPE_INT8            = 0x002,/*!< \brief A <tt>\ref vx_int8</tt>. */
+    VX_TYPE_UINT8           = 0x003,/*!< \brief A <tt>\ref vx_uint8</tt>. */
+    VX_TYPE_INT16           = 0x004,/*!< \brief A <tt>\ref vx_int16</tt>. */
+    VX_TYPE_UINT16          = 0x005,/*!< \brief A <tt>\ref vx_uint16</tt>. */
+    VX_TYPE_INT32           = 0x006,/*!< \brief A <tt>\ref vx_int32</tt>. */
+    VX_TYPE_UINT32          = 0x007,/*!< \brief A <tt>\ref vx_uint32</tt>. */
+    VX_TYPE_INT64           = 0x008,/*!< \brief A <tt>\ref vx_int64</tt>. */
+    VX_TYPE_UINT64          = 0x009,/*!< \brief A <tt>\ref vx_uint64</tt>. */
+    VX_TYPE_FLOAT32         = 0x00A,/*!< \brief A <tt>\ref vx_float32</tt>. */
+    VX_TYPE_FLOAT64         = 0x00B,/*!< \brief A <tt>\ref vx_float64</tt>. */
+    VX_TYPE_ENUM            = 0x00C,/*!< \brief A <tt>\ref vx_enum</tt>. Equivalent in size to a <tt>\ref vx_int32</tt>. */
+    VX_TYPE_SIZE            = 0x00D,/*!< \brief A <tt>\ref vx_size</tt>. */
+    VX_TYPE_DF_IMAGE        = 0x00E,/*!< \brief A <tt>\ref vx_df_image</tt>. */
+#if defined(EXPERIMENTAL_PLATFORM_SUPPORTS_16_FLOAT)
+    VX_TYPE_FLOAT16         = 0x00F,/*!< \brief A <tt>\ref vx_float16</tt>. */
+#endif
+    VX_TYPE_BOOL            = 0x010,/*!< \brief A <tt>\ref vx_bool</tt>. */
+
+    VX_TYPE_RECTANGLE       = 0x020,/*!< \brief A <tt>\ref vx_rectangle_t</tt>. */
+    VX_TYPE_KEYPOINT        = 0x021,/*!< \brief A <tt>\ref vx_keypoint_t</tt>. */
+    VX_TYPE_COORDINATES2D   = 0x022,/*!< \brief A <tt>\ref vx_coordinates2d_t</tt>. */
+    VX_TYPE_COORDINATES3D   = 0x023,/*!< \brief A <tt>\ref vx_coordinates3d_t</tt>. */
+    VX_TYPE_COORDINATES2DF  = 0x024,/*!< \brief A <tt>\ref vx_coordinates2df_t</tt>. */
+
+	/* Reserve enums that are defined in khronos extensions
+		NN extensions:
+		VX_TYPE_NN_CONVOLUTION_PARAMS     = 0x025,
+		VX_TYPE_NN_DECONVOLUTION_PARAMS   = 0x026,
+		VX_TYPE_NN_ROI_POOL_PARAMS        = 0x027,
+		Classifier extension:
+		VX_TYPE_CLASSIFER_MODEL           = 0x02C,
+	*/
+	VX_TYPE_HOG_PARAMS                       = 0x028, /*!< \brief A <tt>\ref vx_hog_t</tt>. */
+	VX_TYPE_HOUGH_LINES_PARAMS               = 0x029, /*!< \brief A <tt>\ref vx_hough_lines_p_t</tt>. */
+	VX_TYPE_LINE_2D                          = 0x02A, /*!< \brief A <tt>\ref vx_line2d_t</tt>. */
+	VX_TYPE_TENSOR_MATRIX_MULTIPLY_PARAMS    = 0x02B, /*!< \brief A <tt>\ref vx_tensor_matrix_multiply_params_t</tt>. */
+
+
+    VX_TYPE_USER_STRUCT_START    = 0x100,/*!< \brief A user-defined struct base index.*/
+    VX_TYPE_VENDOR_STRUCT_START  = 0x400,/*!< \brief A vendor-defined struct base index.*/
+    VX_TYPE_KHRONOS_OBJECT_START = 0x800,/*!< \brief A Khronos defined object base index. */
+    VX_TYPE_VENDOR_OBJECT_START  = 0xC00,/*!< \brief A vendor defined object base index. */
+
+    VX_TYPE_KHRONOS_STRUCT_MAX   = VX_TYPE_USER_STRUCT_START - 1,/*!< \brief A value for comparison between Khronos defined structs and user structs. */
+
+    VX_TYPE_USER_STRUCT_END      = VX_TYPE_VENDOR_STRUCT_START - 1,/*!< \brief A value for comparison between user structs and vendor structs. */
+    VX_TYPE_VENDOR_STRUCT_END    = VX_TYPE_KHRONOS_OBJECT_START - 1,/*!< \brief A value for comparison between vendor structs and Khronos defined objects. */
+    VX_TYPE_KHRONOS_OBJECT_END   = VX_TYPE_VENDOR_OBJECT_START - 1,/*!< \brief A value for comparison between Khronos defined objects and vendor structs. */
+    VX_TYPE_VENDOR_OBJECT_END    = 0xFFF,/*!< \brief A value used for bound checking of vendor objects */
+
+
+    VX_TYPE_REFERENCE       = 0x800,/*!< \brief A <tt>\ref vx_reference</tt>. */
+    VX_TYPE_CONTEXT         = 0x801,/*!< \brief A <tt>\ref vx_context</tt>. */
+    VX_TYPE_GRAPH           = 0x802,/*!< \brief A <tt>\ref vx_graph</tt>. */
+    VX_TYPE_NODE            = 0x803,/*!< \brief A <tt>\ref vx_node</tt>. */
+    VX_TYPE_KERNEL          = 0x804,/*!< \brief A <tt>\ref vx_kernel</tt>. */
+    VX_TYPE_PARAMETER       = 0x805,/*!< \brief A <tt>\ref vx_parameter</tt>. */
+    VX_TYPE_DELAY           = 0x806,/*!< \brief A <tt>\ref vx_delay</tt>. */
+    VX_TYPE_LUT             = 0x807,/*!< \brief A <tt>\ref vx_lut</tt>. */
+    VX_TYPE_DISTRIBUTION    = 0x808,/*!< \brief A <tt>\ref vx_distribution</tt>. */
+    VX_TYPE_PYRAMID         = 0x809,/*!< \brief A <tt>\ref vx_pyramid</tt>. */
+    VX_TYPE_THRESHOLD       = 0x80A,/*!< \brief A <tt>\ref vx_threshold</tt>. */
+    VX_TYPE_MATRIX          = 0x80B,/*!< \brief A <tt>\ref vx_matrix</tt>. */
+    VX_TYPE_CONVOLUTION     = 0x80C,/*!< \brief A <tt>\ref vx_convolution</tt>. */
+    VX_TYPE_SCALAR          = 0x80D,/*!< \brief A <tt>\ref vx_scalar</tt>. when needed to be completely generic for kernel validation. */
+    VX_TYPE_ARRAY           = 0x80E,/*!< \brief A <tt>\ref vx_array</tt>. */
+    VX_TYPE_IMAGE           = 0x80F,/*!< \brief A <tt>\ref vx_image</tt>. */
+    VX_TYPE_REMAP           = 0x810,/*!< \brief A <tt>\ref vx_remap</tt>. */
+    VX_TYPE_ERROR           = 0x811,/*!< \brief An error object which has no type. */
+    VX_TYPE_META_FORMAT     = 0x812,/*!< \brief A <tt>\ref vx_meta_format</tt>. */
+    VX_TYPE_OBJECT_ARRAY    = 0x813,/*!< \brief A <tt>\ref vx_object_array</tt>. */
+    /* Reserved for IX and XML extensions */
+    /* VX_TYPE_IMPORT          = 0x814, !< \brief A <tt>\ref vx_import</tt>. */
+    VX_TYPE_TENSOR          = 0x815,/*!< \brief A <tt>\ref vx_tensor</tt>. */
+	VX_TYPE_TENSOR_PYRAMID  = 0x816,
+    /* \todo add new object types here */
+	VX_TYPE_TENSOR_ARRAY	= 0x817,
+    VX_TYPE_DEVICE_MEMORY_HANDLE = 0x818,
+};
+
+/*! \brief The enumeration of all status codes.
+ * \see vx_status.
+ * \ingroup group_basic_features
+ */
+enum vx_status_e {
+    VX_STATUS_MIN                       = -25,/*!< \brief Indicates the lower bound of status codes in VX. Used for bounds checks only. */
+    /* add new codes here */
+    VX_ERROR_REFERENCE_NONZERO          = -24,/*!< \brief Indicates that an operation did not complete due to a reference count being non-zero. */
+    VX_ERROR_MULTIPLE_WRITERS           = -23,/*!< \brief Indicates that the graph has more than one node outputting to the same data object. This is an invalid graph structure. */
+    VX_ERROR_GRAPH_ABANDONED            = -22,/*!< \brief Indicates that the graph is stopped due to an error or a callback that abandoned execution. */
+    VX_ERROR_GRAPH_SCHEDULED            = -21,/*!< \brief Indicates that the supplied graph already has been scheduled and may be currently executing. */
+    VX_ERROR_INVALID_SCOPE              = -20,/*!< \brief Indicates that the supplied parameter is from another scope and cannot be used in the current scope. */
+    VX_ERROR_INVALID_NODE               = -19,/*!< \brief Indicates that the supplied node could not be created.*/
+    VX_ERROR_INVALID_GRAPH              = -18,/*!< \brief Indicates that the supplied graph has invalid connections (cycles). */
+    VX_ERROR_INVALID_TYPE               = -17,/*!< \brief Indicates that the supplied type parameter is incorrect. */
+    VX_ERROR_INVALID_VALUE              = -16,/*!< \brief Indicates that the supplied parameter has an incorrect value. */
+    VX_ERROR_INVALID_DIMENSION          = -15,/*!< \brief Indicates that the supplied parameter is too big or too small in dimension. */
+    VX_ERROR_INVALID_FORMAT             = -14,/*!< \brief Indicates that the supplied parameter is in an invalid format. */
+    VX_ERROR_INVALID_LINK               = -13,/*!< \brief Indicates that the link is not possible as specified. The parameters are incompatible. */
+    VX_ERROR_INVALID_REFERENCE          = -12,/*!< \brief Indicates that the reference provided is not valid. */
+    VX_ERROR_INVALID_MODULE             = -11,/*!< \brief This is returned from <tt>\ref vxLoadKernels</tt> when the module does not contain the entry point. */
+    VX_ERROR_INVALID_PARAMETERS         = -10,/*!< \brief Indicates that the supplied parameter information does not match the kernel contract. */
+    VX_ERROR_OPTIMIZED_AWAY             = -9,/*!< \brief Indicates that the object refered to has been optimized out of existence. */
+    VX_ERROR_NO_MEMORY                  = -8,/*!< \brief Indicates that an internal or implicit allocation failed. Typically catastrophic. After detection, deconstruct the context. \see vxVerifyGraph. */
+    VX_ERROR_NO_RESOURCES               = -7,/*!< \brief Indicates that an internal or implicit resource can not be acquired (not memory). This is typically catastrophic. After detection, deconstruct the context. \see vxVerifyGraph. */
+    VX_ERROR_NOT_COMPATIBLE             = -6,/*!< \brief Indicates that the attempt to link two parameters together failed due to type incompatibilty. */
+    VX_ERROR_NOT_ALLOCATED              = -5,/*!< \brief Indicates to the system that the parameter must be allocated by the system.  */
+    VX_ERROR_NOT_SUFFICIENT             = -4,/*!< \brief Indicates that the given graph has failed verification due to an insufficient number of required parameters, which cannot be automatically created. Typically this indicates required atomic parameters. \see vxVerifyGraph. */
+    VX_ERROR_NOT_SUPPORTED              = -3,/*!< \brief Indicates that the requested set of parameters produce a configuration that cannot be supported. Refer to the supplied documentation on the configured kernels. \see vx_kernel_e. This is also returned if a function to set an attribute is called on a Read-only attribute.*/
+    VX_ERROR_NOT_IMPLEMENTED            = -2,/*!< \brief Indicates that the requested kernel is missing. \see vx_kernel_e vxGetKernelByName. */
+    VX_FAILURE                          = -1,/*!< \brief Indicates a generic error code, used when no other describes the error. */
+    VX_SUCCESS                          =  0,/*!< \brief No error. */
+};
+
+/*! \brief A formal status type with known fixed size.
+ * \see vx_status_e
+ * \ingroup group_basic_features
+ */
+typedef vx_enum vx_status;
+
+/*! \brief The formal typedef of the response from the callback.
+ * \see vx_action_e
+ * \ingroup group_node_callback
+ */
+typedef vx_enum vx_action;
+
+/*! \brief A callback to the client after a particular node has completed.
+ * \see vx_action
+ * \see vxAssignNodeCallback
+ * \param [in] node The node to which the callback was attached.
+ * \return An action code from <tt>\ref vx_action_e</tt>.
+ * \ingroup group_node_callback
+ */
+typedef vx_action (VX_CALLBACK *vx_nodecomplete_f)(vx_node node);
+
+/*! \brief Vendor IDs are 2 nibbles in size and are located in the upper byte of
+ * the 4 bytes of an enumeration.
+ * \ingroup group_basic_features
+ */
+#define VX_VENDOR_MASK                      (0xFFF00000)
+
+/*! \brief A type mask removes the scalar/object type from the attribute.
+ * It is 3 nibbles in size and is contained between the third and second byte.
+ * \see vx_type_e
+ * \ingroup group_basic_features
+ */
+#define VX_TYPE_MASK                        (0x000FFF00)
+
+/*! \brief A library is a set of vision kernels with its own ID supplied by a vendor.
+ * The vendor defines the library ID. The range is \f$ [0,2^{8}-1] \f$ inclusive.
+ * \ingroup group_basic_features
+ */
+#define VX_LIBRARY_MASK                     (0x000FF000)
+
+/*! \brief An individual kernel in a library has its own unique ID within \f$ [0,2^{12}-1] \f$ (inclusive).
+ * \ingroup group_basic_features
+ */
+#define VX_KERNEL_MASK                      (0x00000FFF)
+
+/*! \brief An object's attribute ID is within the range of \f$ [0,2^{8}-1] \f$ (inclusive).
+ * \ingroup group_basic_features
+ */
+#define VX_ATTRIBUTE_ID_MASK                (0x000000FF)
+
+/*! \brief A type of enumeration. The valid range is between \f$ [0,2^{8}-1] \f$ (inclusive).
+ * \ingroup group_basic_features
+ */
+#define VX_ENUM_TYPE_MASK                   (0x000FF000)
+
+/*! \brief A generic enumeration list can have values between \f$ [0,2^{12}-1] \f$ (inclusive).
+ * \ingroup group_basic_features
+ */
+#define VX_ENUM_MASK                        (0x00000FFF)
+
+/*! \brief A macro to extract the vendor ID from the enumerated value.
+ * \ingroup group_basic_features
+ */
+#define VX_VENDOR(e)                        (((vx_uint32)e & VX_VENDOR_MASK) >> 20)
+
+/*! \brief A macro to extract the type from an enumerated attribute value.
+ * \ingroup group_basic_features
+ */
+#define VX_TYPE(e)                          (((vx_uint32)e & VX_TYPE_MASK) >> 8)
+
+/*! \brief A macro to extract the enum type from an enumerated value.
+ * \ingroup group_basic_features
+ */
+#define VX_ENUM_TYPE(e)                     (((vx_uint32)e & VX_ENUM_TYPE_MASK) >> 12)
+
+/*! \brief A macro to extract the kernel library enumeration from a enumerated kernel value.
+ * \ingroup group_basic_features
+ */
+#define VX_LIBRARY(e)                       (((vx_uint32)e & VX_LIBRARY_MASK) >> 12)
+
+/*! \def VX_DF_IMAGE
+ * \brief Converts a set of four chars into a \c uint32_t container of a VX_DF_IMAGE code.
+ * \note Use a <tt>\ref vx_df_image</tt> variable to hold the value.
+ * \ingroup group_basic_features
+ */
+#define VX_DF_IMAGE(a,b,c,d)                  ((a) | (b << 8) | (c << 16) | (d << 24))
+
+/*! \def VX_ATTRIBUTE_BASE
+ * \brief Defines the manner in which to combine the Vendor and Object IDs to get
+ * the base value of the enumeration.
+ * \ingroup group_basic_features
+ */
+#define VX_ATTRIBUTE_BASE(vendor, object)   (((vendor) << 20) | (object << 8))
+
+/*! \def VX_KERNEL_BASE
+ * \brief Defines the manner in which to combine the Vendor and Library IDs to get
+ * the base value of the enumeration.
+ * \ingroup group_basic_features
+ */
+#define VX_KERNEL_BASE(vendor, lib)         (((vendor) << 20) | (lib << 12))
+
+/*! \def VX_ENUM_BASE
+ * \brief Defines the manner in which to combine the Vendor and Object IDs to get
+ * the base value of the enumeration.
+ * \details From any enumerated value (with exceptions), the vendor, and enumeration
+ * type should be extractable. Those types that are exceptions are
+ * <tt>\ref vx_vendor_id_e</tt>, <tt>\ref vx_type_e</tt>, <tt>\ref vx_enum_e</tt>, <tt>\ref vx_df_image_e</tt>, and \c vx_bool.
+ * \ingroup group_basic_features
+ */
+#define VX_ENUM_BASE(vendor, id)            (((vendor) << 20) | (id << 12))
+
+/*! \brief The set of supported enumerations in OpenVX.
+ * \details These can be extracted from enumerated values using <tt>\ref VX_ENUM_TYPE</tt>.
+ * \ingroup group_basic_features
+ */
+enum vx_enum_e {
+    VX_ENUM_DIRECTION       = 0x00, /*!< \brief Parameter Direction. */
+    VX_ENUM_ACTION          = 0x01, /*!< \brief Action Codes. */
+    VX_ENUM_HINT            = 0x02, /*!< \brief Hint Values. */
+    VX_ENUM_DIRECTIVE       = 0x03, /*!< \brief Directive Values. */
+    VX_ENUM_INTERPOLATION   = 0x04, /*!< \brief Interpolation Types. */
+    VX_ENUM_OVERFLOW        = 0x05, /*!< \brief Overflow Policies. */
+    VX_ENUM_COLOR_SPACE     = 0x06, /*!< \brief Color Space. */
+    VX_ENUM_COLOR_RANGE     = 0x07, /*!< \brief Color Space Range. */
+    VX_ENUM_PARAMETER_STATE = 0x08, /*!< \brief Parameter State. */
+    VX_ENUM_CHANNEL         = 0x09, /*!< \brief Channel Name. */
+    VX_ENUM_CONVERT_POLICY  = 0x0A, /*!< \brief Convert Policy. */
+    VX_ENUM_THRESHOLD_TYPE  = 0x0B, /*!< \brief Threshold Type List. */
+    VX_ENUM_BORDER          = 0x0C, /*!< \brief Border Mode List. */
+    VX_ENUM_COMPARISON      = 0x0D, /*!< \brief Comparison Values. */
+    VX_ENUM_MEMORY_TYPE     = 0x0E, /*!< \brief The memory type enumeration. */
+    VX_ENUM_TERM_CRITERIA   = 0x0F, /*!< \brief A termination criteria. */
+    VX_ENUM_NORM_TYPE       = 0x10, /*!< \brief A norm type. */
+    VX_ENUM_ACCESSOR        = 0x11, /*!< \brief An accessor flag type. */
+    VX_ENUM_ROUND_POLICY    = 0x12, /*!< \brief Rounding Policy. */
+    VX_ENUM_TARGET          = 0x13, /*!< \brief Target. */
+    VX_ENUM_BORDER_POLICY   = 0x14, /*!< \brief Unsupported Border Mode Policy List. */
+    VX_ENUM_GRAPH_STATE     = 0x15, /*!< \brief Graph attribute states. */
+    VX_ENUM_NONLINEAR       = 0x16, /*!< \brief Non-linear function list. */
+    VX_ENUM_PATTERN         = 0x17, /*!< \brief Matrix pattern enumeration. */
+    VX_ENUM_LBP_FORMAT      = 0x18, /*!< \brief Lbp format. */
+    VX_ENUM_COMP_METRIC     = 0x19, /*!< \brief Compare metric. */
+/* NN extension
+    VX_ENUM_NN_ROUNDING_TYPE	= 0x1A,
+    VX_ENUM_NN_POOLING_TYPE	= 0x1B,
+    VX_ENUM_NN_NORMALIZATION_TYPE	= 0x1C,
+    VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE	= 0x1D,
+*/
+/* Classifier extension
+	VX_ENUM_CLASSIFIER_MODEL= 0x1E,
+*/
+/* IX extension
+    VX_ENUM_IX_USE          = 0x1F, !< \brief How to use references in import and export. */
+    VX_ENUM_SCALAR_OPERATION= 0X20  /*!< \brief Scalar operation list. */
+	};
+
+/*! \brief A return code enumeration from a <tt>\ref vx_nodecomplete_f</tt> during execution.
+ * \see <tt>vxAssignNodeCallback</tt>
+ * \ingroup group_node_callback
+ */
+enum vx_action_e {
+    /*! \brief Continue executing the graph with no changes. */
+    VX_ACTION_CONTINUE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACTION) + 0x0,
+    /*! \brief Stop executing the graph. */
+    VX_ACTION_ABANDON  = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACTION) + 0x1,
+};
+
+/*! \brief An indication of how a kernel will treat the given parameter.
+ * \ingroup group_parameter
+ */
+enum vx_direction_e {
+    /*! \brief The parameter is an input only. */
+    VX_INPUT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTION) + 0x0,
+    /*! \brief The parameter is an output only. */
+    VX_OUTPUT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTION) + 0x1,
+    /*! \brief The parameter is both an input and output. */
+    VX_BIDIRECTIONAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTION) + 0x2,
+};
+
+/*! \brief These enumerations are given to the <tt>\ref vxHint</tt> API to enable/disable platform
+ * optimizations and/or features. Hints are optional and usually are vendor-specific.
+ * \see <tt>\ref vxHint</tt>
+ * \ingroup group_hint
+ */
+enum vx_hint_e {
+    /*! \brief Indicates to the implementation that user do not apply any specific
+     *  requirements for performance.
+     */
+    VX_HINT_PERFORMANCE_DEFAULT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_HINT) + 0x1,
+    /*! \brief Indicates the user preference is low power consumption versus
+     * highest performance.
+     */
+    VX_HINT_PERFORMANCE_LOW_POWER = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_HINT) + 0x2,
+    /*! \brief Indicates the user preference for highest performance over
+     * low power consumption.
+     */
+    VX_HINT_PERFORMANCE_HIGH_SPEED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_HINT) + 0x3,
+};
+
+/*! \brief These enumerations are given to the \c vxDirective API to enable/disable
+ * platform optimizations and/or features. Directives are not optional and
+ * usually are vendor-specific, by defining a vendor range of directives and
+ * starting their enumeration from there.
+ * \see <tt>vxDirective</tt>
+ * \ingroup group_directive
+ */
+enum vx_directive_e {
+    /*! \brief Disables recording information for graph debugging. */
+    VX_DIRECTIVE_DISABLE_LOGGING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTIVE) + 0x0,
+    /*! \brief Enables recording information for graph debugging. */
+    VX_DIRECTIVE_ENABLE_LOGGING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTIVE) + 0x1,
+    /*! \brief Disables performance counters for the context. By default performance counters are disabled */
+    VX_DIRECTIVE_DISABLE_PERFORMANCE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTIVE) + 0x2,
+    /*! \brief Enables performance counters for the context. */
+    VX_DIRECTIVE_ENABLE_PERFORMANCE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTIVE) + 0x3,
+};
+
+/*! \brief The Graph State Enumeration.
+ * \ingroup group_graph
+ */
+enum vx_graph_state_e {
+   /*! \brief The graph should be verified before execution */
+   VX_GRAPH_STATE_UNVERIFIED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x0,
+   /*! \brief The graph has been verified and has not been executed or scheduled for execution yet */
+   VX_GRAPH_STATE_VERIFIED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x1,
+   /*! \brief The graph either has been scheduled and not completed, or is being executed */
+   VX_GRAPH_STATE_RUNNING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x2,
+   /*! \brief The graph execution was abandoned */
+   VX_GRAPH_STATE_ABANDONED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x3,
+   /*! \brief The graph execution is completed and the graph is not scheduled for execution */
+   VX_GRAPH_STATE_COMPLETED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_GRAPH_STATE) + 0x4,
+};
+
+/*! \brief The graph attributes list.
+ * \ingroup group_graph
+ */
+enum vx_graph_attribute_e {
+    /*! \brief Returns the number of nodes in a graph. Read-only. Use a <tt>\ref vx_uint32</tt> parameter.*/
+    VX_GRAPH_NUMNODES = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x0,
+    /*! \brief Returns the overall performance of the graph. Read-only. Use a <tt>\ref vx_perf_t</tt> parameter.
+     * The accuracy of timing information is platform dependent.
+     * \note Performance tracking must have been enabled. See <tt>\ref vx_directive_e</tt>
+     */
+    VX_GRAPH_PERFORMANCE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x2,
+    /*! \brief Returns the number of explicitly declared parameters on the graph. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_GRAPH_NUMPARAMETERS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x3,
+    /*! \brief Returns the state of the graph. See <tt>\ref vx_graph_state_e</tt> enum. */
+    VX_GRAPH_STATE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x4,
+};
+
+/*! \brief The Conversion Policy Enumeration.
+ * \ingroup group_basic_features
+ */
+enum vx_convert_policy_e {
+    /*! \brief Results are the least significant bits of the output operand, as if
+     * stored in two's complement binary format in the size of its bit-depth.
+     */
+    VX_CONVERT_POLICY_WRAP = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CONVERT_POLICY) + 0x0,
+    /*! \brief Results are saturated to the bit depth of the output operand. */
+    VX_CONVERT_POLICY_SATURATE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CONVERT_POLICY) + 0x1,
+};
+
+//enum vx_resize_policy_e {
+	/*! \brief Results are the least significant bits of the output operand, as if
+	* stored in two's complement binary format in the size of its bit-depth.
+	*/
+//	VX_CONVERT_POLICY_WRAP = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CONVERT_POLICY) + 0x0,
+	/*! \brief Results are saturated to the bit depth of the output operand. */
+//	VX_CONVERT_POLICY_SATURATE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CONVERT_POLICY) + 0x1,
+//};
+
+/*! \brief Based on the VX_DF_IMAGE definition.
+ * \note Use <tt>\ref vx_df_image</tt> to contain these values.
+ * \ingroup group_basic_features
+ */
+enum vx_df_image_e {
+    /*! \brief A virtual image of no defined type. */
+    VX_DF_IMAGE_VIRT = VX_DF_IMAGE('V','I','R','T'),
+    /*! \brief A single plane of 24-bit pixel as 3 interleaved 8-bit units of
+     * R then G then B data. This uses the BT709 full range by default.
+     */
+    VX_DF_IMAGE_RGB  = VX_DF_IMAGE('R','G','B','2'),
+    /*! \brief A single plane of 32-bit pixel as 4 interleaved 8-bit units of
+     * R then G then B data, then a <i>don't care</i> byte.
+     * This uses the BT709 full range by default.
+     */
+    VX_DF_IMAGE_RGBX = VX_DF_IMAGE('R','G','B','A'),
+    /*! \brief A 2-plane YUV format of Luma (Y) and interleaved UV data at
+     * 4:2:0 sampling. This uses the BT709 full range by default.
+     */
+    VX_DF_IMAGE_NV12 = VX_DF_IMAGE('N','V','1','2'),
+    /*! \brief A 2-plane YUV format of Luma (Y) and interleaved VU data at
+     * 4:2:0 sampling. This uses the BT709 full range by default.
+     */
+    VX_DF_IMAGE_NV21 = VX_DF_IMAGE('N','V','2','1'),
+    /*! \brief A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 bytes.
+     * This uses the BT709 full range by default.
+     */
+    VX_DF_IMAGE_UYVY = VX_DF_IMAGE('U','Y','V','Y'),
+    /*! \brief A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
+     * This uses the BT709 full range by default.
+     */
+    VX_DF_IMAGE_YUYV = VX_DF_IMAGE('Y','U','Y','V'),
+    /*! \brief A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.
+     * This uses the BT709 full range by default.
+     */
+    VX_DF_IMAGE_IYUV = VX_DF_IMAGE('I','Y','U','V'),
+    /*! \brief A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
+     * This uses the BT709 full range by default.
+     */
+    VX_DF_IMAGE_YUV4 = VX_DF_IMAGE('Y','U','V','4'),
+    /*! \brief A single plane of unsigned 8-bit data.
+     * The range of data is not specified, as it may be extracted from a YUV or
+     * generated.
+     */
+    VX_DF_IMAGE_U8 = VX_DF_IMAGE('U','0','0','8'),
+    /*! \brief A single plane of unsigned 16-bit data.
+     * The range of data is not specified, as it may be extracted from a YUV or
+     * generated.
+     */
+    VX_DF_IMAGE_U16  = VX_DF_IMAGE('U','0','1','6'),
+    /*! \brief A single plane of signed 16-bit data.
+     * The range of data is not specified, as it may be extracted from a YUV or
+     * generated.
+     */
+    VX_DF_IMAGE_S16  = VX_DF_IMAGE('S','0','1','6'),
+    /*! \brief A single plane of unsigned 32-bit data.
+     * The range of data is not specified, as it may be extracted from a YUV or
+     * generated.
+     */
+    VX_DF_IMAGE_U32  = VX_DF_IMAGE('U','0','3','2'),
+    /*! \brief A single plane of unsigned 32-bit data.
+     * The range of data is not specified, as it may be extracted from a YUV or
+     * generated.
+     */
+    VX_DF_IMAGE_S32  = VX_DF_IMAGE('S','0','3','2'),
+};
+
+/*! \brief The Target Enumeration.
+ * \ingroup group_basic_features
+ */
+enum vx_target_e {
+    /*! \brief Any available target. An OpenVX implementation must support at least one target associated with this value */
+    VX_TARGET_ANY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TARGET) + 0x0000,
+    /*! \brief Target, explicitly specified by its (case-insensitive) name string. */
+    VX_TARGET_STRING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TARGET) + 0x0001,
+    /*! \brief Start of Vendor specific target enumerates. */
+    VX_TARGET_VENDOR_BEGIN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TARGET) + 0x1000,
+};
+
+/*! \brief The reference attributes list.
+ * \ingroup group_reference
+ */
+enum vx_reference_attribute_e {
+    /*! \brief Returns the reference count of the object. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_REFERENCE_COUNT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REFERENCE) + 0x0,
+    /*! \brief Returns the <tt>\ref vx_type_e</tt> of the reference. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_REFERENCE_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REFERENCE) + 0x1,
+    /*! \brief Used to query the reference for its name. Read-write. Use a *<tt>\ref vx_char</tt> parameter. */
+    VX_REFERENCE_NAME = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REFERENCE) + 0x2,
+};
+
+/*! \brief A list of context attributes.
+ * \ingroup group_context
+ */
+enum vx_context_attribute_e {
+    /*! \brief Queries the unique vendor ID. Read-only. Use a <tt>\ref vx_uint16</tt>. */
+    VX_CONTEXT_VENDOR_ID = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x0,
+    /*! \brief Queries the OpenVX Version Number. Read-only. Use a <tt>\ref vx_uint16</tt> */
+    VX_CONTEXT_VERSION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x1,
+    /*! \brief Queries the context for the number of \e unique kernels. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_CONTEXT_UNIQUE_KERNELS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x2,
+    /*! \brief Queries the context for the number of active modules. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_CONTEXT_MODULES = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x3,
+    /*! \brief Queries the context for the number of active references. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_CONTEXT_REFERENCES = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x4,
+    /*! \brief Queries the context for it's implementation name. Read-only. Use a <tt>\ref vx_char</tt>[<tt>\ref VX_MAX_IMPLEMENTATION_NAME</tt>] array */
+    VX_CONTEXT_IMPLEMENTATION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x5,
+    /*! \brief Queries the number of bytes in the extensions string. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_CONTEXT_EXTENSIONS_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x6,
+    /*! \brief Retrieves the extensions string. Read-only.
+     * This is a space-separated string of extension names. Each OpenVX official extension has a unique identifier,
+     * comprised of capital letters, numbers and the underscore character, prefixed with "KHR_", for example "KHR_NEW_FEATURE".
+     * Use a <tt>\ref vx_char</tt> pointer allocated to the size returned from <tt>\ref VX_CONTEXT_EXTENSIONS_SIZE</tt>.
+     */
+    VX_CONTEXT_EXTENSIONS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x7,
+    /*! \brief The maximum width or height of a convolution matrix.
+     * Read-only. Use a <tt>\ref vx_size</tt> parameter.
+     * Each vendor must support centered kernels of size w X h, where both w
+     * and h are odd numbers, 3 <= w <= n and 3 <= h <= n, where n is the value of the
+     * <tt>\ref VX_CONTEXT_CONVOLUTION_MAX_DIMENSION</tt> attribute. n is an odd
+     * number that should not be smaller than 9. w and h may or may not be equal to
+     * each other. All combinations of w and h meeting the conditions above must be
+     * supported. The behavior of <tt>\ref vxCreateConvolution</tt> is undefined for values
+     * larger than the value returned by this attribute.
+     */
+    VX_CONTEXT_CONVOLUTION_MAX_DIMENSION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x8,
+    /*! \brief The maximum window dimension of the OpticalFlowPyrLK kernel. The value of this attribute shall be equal to or greater than '9'.
+     * \see <tt>\ref VX_KERNEL_OPTICAL_FLOW_PYR_LK</tt>. Read-only. Use a <tt>\ref vx_size</tt> parameter.
+     */
+    VX_CONTEXT_OPTICAL_FLOW_MAX_WINDOW_DIMENSION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0x9,
+    /*! \brief The border mode for immediate mode functions.
+     * \details Graph mode functions are unaffected by this attribute. Read-write. Use a pointer to a <tt>\ref vx_border_t</tt> structure as parameter.
+     * \note The assumed default value for immediate mode functions is <tt>\ref VX_BORDER_UNDEFINED</tt>.
+     */
+    VX_CONTEXT_IMMEDIATE_BORDER = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xA,
+    /*! \brief Returns the table of all unique the kernels that exist in the context.
+     *  Read-only. Use a <tt>\ref vx_kernel_info_t</tt> array.
+     * \pre You must call <tt>\ref vxQueryContext</tt> with <tt>\ref VX_CONTEXT_UNIQUE_KERNELS</tt>
+     * to compute the necessary size of the array.
+     */
+    VX_CONTEXT_UNIQUE_KERNEL_TABLE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xB,
+    /*! \brief The unsupported border mode policy for immediate mode functions. Read-Write.
+     * \details Graph mode functions are unaffected by this attribute. Use a <tt>\ref vx_enum</tt> as parameter. Will contain a <tt>\ref vx_border_policy_e</tt>.
+     * \note The assumed default value for immediate mode functions is <tt>\ref VX_BORDER_POLICY_DEFAULT_TO_UNDEFINED</tt>. Users should refer to the documentation of their implementation to determine what border modes are supported by each kernel.
+     */
+    VX_CONTEXT_IMMEDIATE_BORDER_POLICY = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xC,
+    /*! \brief The dimension of the largest nonlinear filter supported. See <tt>\ref vxNonLinearFilterNode</tt>.
+     * \details The implementation must support all dimensions (height or width, not necessarily the same)
+     * up to the value of this attribute.  The lowest value that must be supported for this attribute is 9.
+     * Read-only. Use a <tt>\ref vx_size</tt> parameter.
+     */
+    VX_CONTEXT_NONLINEAR_MAX_DIMENSION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xd,
+    /*! \brief tensor Data maximal number of dimensions supported by the implementation. */
+    VX_CONTEXT_MAX_TENSOR_DIMS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xE,
+};
+
+/*! \brief The kernel attributes list
+ * \ingroup group_kernel
+ */
+enum vx_kernel_attribute_e {
+    /*! \brief Queries a kernel for the number of parameters the kernel
+     * supports. Read-only. Use a <tt>\ref vx_uint32</tt> parameter.
+     */
+    VX_KERNEL_PARAMETERS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x0,
+    /*! \brief Queries the name of the kernel. Not settable.
+     *  Read-only. Use a <tt>\ref vx_char</tt>[<tt>\ref VX_MAX_KERNEL_NAME</tt>] array (not a <tt>\ref vx_array</tt>).
+     */
+    VX_KERNEL_NAME = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x1,
+    /*! \brief Queries the enum of the kernel. Not settable.
+     *  Read-only. Use a <tt>\ref vx_enum</tt> parameter.
+     */
+    VX_KERNEL_ENUM = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x2,
+    /*! \brief The local data area allocated with each kernel when it becomes a
+     * node.  Read-write. Can be written only before user-kernel finalization.
+     * Use a <tt>\ref vx_size</tt> parameter.
+     * \note If not set it will default to zero.
+     */
+    VX_KERNEL_LOCAL_DATA_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x3,
+};
+
+/*! \brief The kernel object attributes for global and local memory.
+* \ingroup group_kernel
+*/
+enum vx_kernel_attribute_memory_e {
+	/*! \brief The global data pointer size to be shared across all instances of
+	* the kernel (nodes are instances of kernels).
+	* Use a \ref vx_size parameter.
+	* \note If not set it will default to zero.
+	*/
+	VX_KERNEL_GLOBAL_DATA_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x5,
+	/*! \brief The global data pointer to the shared across all the instances of
+	* the kernel (nodes are instances of the kernels).
+	* Use a \ref void * parameter.
+	*/
+	VX_KERNEL_GLOBAL_DATA_PTR = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x6,
+};
+
+/*! \brief The node attributes list.
+ * \ingroup group_node
+ */
+enum vx_node_attribute_e {
+    /*! \brief Queries the status of node execution. Read-only. Use a <tt>\ref vx_status</tt> parameter. */
+    VX_NODE_STATUS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x0,
+    /*! \brief Queries the performance of the node execution.
+     * The accuracy of timing information is platform dependent and also depends on the graph
+     * optimizations. Read-only.
+     * \note Performance tracking must have been enabled. See <tt>\ref vx_directive_e</tt>.
+     */
+    VX_NODE_PERFORMANCE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x1,
+    /*! \brief Gets or sets the border mode of the node.
+     * Read-write. Use a <tt>\ref vx_border_t</tt> structure with a default value of VX_BORDER_UNDEFINED.
+     */
+    VX_NODE_BORDER = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x2,
+    /*! \brief Indicates the size of the kernel local memory area.
+     * Read-only. Can be written only at user-node (de)initialization if VX_KERNEL_LOCAL_DATA_SIZE==0.
+     * Use a <tt>\ref vx_size</tt> parameter.
+     */
+    VX_NODE_LOCAL_DATA_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x3,
+    /*! \brief Indicates the pointer kernel local memory area.
+     * Read-Write. Can be written only at user-node (de)initialization if VX_KERNEL_LOCAL_DATA_SIZE==0.
+     * Use a void * parameter.
+     */
+    VX_NODE_LOCAL_DATA_PTR = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x4,
+    /*! \brief Indicates the number of node parameters, including optional parameters that are not passed.
+     * Read-only. Use a <tt>\ref vx_uint32</tt> parameter.
+     */
+    VX_NODE_PARAMETERS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x5,
+    /*! \brief Indicates whether the node is replicated. Read-only.
+     * Use a <tt>\ref vx_bool</tt> parameter.
+     */
+    VX_NODE_IS_REPLICATED = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x6,
+    /*! \brief Indicates the replicated parameters. Read-only.
+     * Use a <tt>\ref vx_bool</tt>* parameter.
+     */
+    VX_NODE_REPLICATE_FLAGS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x7,
+    /*! \brief Indicates the behavior with respect to the valid rectangle. Read-only.
+     * Use a <tt>\ref vx_bool</tt> parameter.
+     */
+    VX_NODE_VALID_RECT_RESET = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x8,
+};
+
+/*! \brief The parameter attributes list
+ * \ingroup group_parameter
+ */
+enum vx_parameter_attribute_e {
+    /*! \brief Queries a parameter for its index value on the kernel with which it is associated. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_PARAMETER_INDEX = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x0,
+    /*! \brief Queries a parameter for its direction value on the kernel with which it is associated. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_PARAMETER_DIRECTION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x1,
+    /*! \brief Queries a parameter for its type, \ref vx_type_e is returned. Read-only. The size of the parameter is implied for plain data objects. For opaque data objects like images and arrays a query to their attributes has to be called to determine the size. */
+    VX_PARAMETER_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x2,
+    /*! \brief Queries a parameter for its state. A value in <tt>\ref vx_parameter_state_e</tt> is returned. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_PARAMETER_STATE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x3,
+    /*! \brief Use to extract the reference contained in the parameter. Read-only. Use a <tt>\ref vx_reference</tt> parameter.  */
+    VX_PARAMETER_REF = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PARAMETER) + 0x4,
+};
+
+/*! \brief The image attributes list.
+ * \ingroup group_image
+ */
+enum vx_image_attribute_e {
+    /*! \brief Queries an image for its width. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_IMAGE_WIDTH = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x0,
+    /*! \brief Queries an image for its height. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_IMAGE_HEIGHT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x1,
+    /*! \brief Queries an image for its format. Read-only. Use a <tt>\ref vx_df_image</tt> parameter. */
+    VX_IMAGE_FORMAT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x2,
+    /*! \brief Queries an image for its number of planes. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_IMAGE_PLANES = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x3,
+    /*! \brief Queries an image for its color space (see <tt>\ref vx_color_space_e</tt>). Read-write. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_IMAGE_SPACE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x4,
+    /*! \brief Queries an image for its channel range (see <tt>\ref vx_channel_range_e</tt>). Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_IMAGE_RANGE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x5,
+    /*! \brief Queries memory type if created using vxCreateImageFromHandle. If vx_image was not created using
+        vxCreateImageFromHandle, VX_MEMORY_TYPE_NONE is returned. Use a <tt>\ref vx_memory_type_e</tt> parameter. */
+    VX_IMAGE_MEMORY_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x7,
+    /*! \brief Queries if an image is uniform. Read-only. Use a <tt>\ref vx_bool</tt> parameter */
+    VX_IMAGE_IS_UNIFORM = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x8,
+    /*! \brief Queries the image uniform value if any. Read-only. Use a <tt>\ref vx_pixel_value_t</tt> parameter. */
+    VX_IMAGE_UNIFORM_VALUE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x9,
+};
+
+/*! \brief The scalar attributes list.
+ * \ingroup group_scalar
+ */
+enum vx_scalar_attribute_e {
+    /*! \brief Queries the type of atomic that is contained in the scalar. Read-only. Use a <tt>\ref vx_enum</tt> parameter.*/
+    VX_SCALAR_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_SCALAR) + 0x0,
+};
+
+/*! \brief A type of operation in which both operands are scalars.
+ * \see group_scalar
+ * \ingroup group_scalar
+ */
+enum vx_scalar_operation_e {
+    /*! \brief logical and. */
+    VX_SCALAR_OP_AND = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x0,
+    /*! \brief logical or. */
+    VX_SCALAR_OP_OR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x1,
+    /*! \brief logical exclusive or. */
+    VX_SCALAR_OP_XOR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x2,
+    /*! \brief logical nand. */
+    VX_SCALAR_OP_NAND = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x3,
+    /*! \brief comparison (equal). */
+    VX_SCALAR_OP_EQUAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x4,
+    /*! \brief comparison (not equal). */
+    VX_SCALAR_OP_NOTEQUAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x5,
+    /*! \brief comparison (less than). */
+    VX_SCALAR_OP_LESS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x6,
+    /*! \brief comparison (less than or equal to). */
+    VX_SCALAR_OP_LESSEQ = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x7,
+    /*! \brief comparison (greater than). */
+    VX_SCALAR_OP_GREATER = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x8,
+    /*! \brief comparison (greater than or equal to). */
+    VX_SCALAR_OP_GREATEREQ = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x9,
+    /*! \brief arithmetic addition. */
+    VX_SCALAR_OP_ADD = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xA,
+    /*! \brief arithmetic subtraction. */
+    VX_SCALAR_OP_SUBTRACT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xB,
+    /*! \brief arithmetic multiplication. */
+    VX_SCALAR_OP_MULTIPLY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xC,
+    /*! \brief arithmetic division. */
+    VX_SCALAR_OP_DIVIDE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xD,
+    /*! \brief arithmetic (modulo operator). */
+    VX_SCALAR_OP_MODULUS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xE,
+    /*! \brief minimum of two scalars. */
+    VX_SCALAR_OP_MIN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xF,
+    /*! \brief maximum of two scalars. */
+    VX_SCALAR_OP_MAX = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x10,
+};
+
+/*! \brief The Look-Up Table (LUT) attribute list.
+ * \ingroup group_lut
+ */
+enum vx_lut_attribute_e {
+    /*! \brief Indicates the value type of the LUT. Read-only. Use a <tt>\ref vx_enum</tt>. */
+    VX_LUT_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS,VX_TYPE_LUT) + 0x0,
+    /*! \brief Indicates the number of elements in the LUT. Read-only. Use a <tt>\ref vx_size</tt>. */
+    VX_LUT_COUNT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS,VX_TYPE_LUT) + 0x1,
+    /*! \brief Indicates the total size of the LUT in bytes. Read-only. Uses a <tt>\ref vx_size</tt>. */
+    VX_LUT_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS,VX_TYPE_LUT) + 0x2,
+    /*! \brief Indicates the index of the input value = 0. Read-only. Uses a <tt>\ref vx_uint32</tt>. */
+    VX_LUT_OFFSET = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS,VX_TYPE_LUT) + 0x3,
+};
+
+/*! \brief The distribution attribute list.
+ * \ingroup group_distribution
+ */
+enum vx_distribution_attribute_e {
+    /*! \brief Indicates the number of dimensions in the distribution. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_DISTRIBUTION_DIMENSIONS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DISTRIBUTION) + 0x0,
+    /*! \brief Indicates the start of the values to use (inclusive). Read-only. Use a <tt>\ref vx_int32</tt> parameter. */
+    VX_DISTRIBUTION_OFFSET = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DISTRIBUTION) + 0x1,
+    /*! \brief Indicates the total number of the consecutive values of the distribution interval. */
+    VX_DISTRIBUTION_RANGE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DISTRIBUTION) + 0x2,
+    /*! \brief Indicates the number of bins. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_DISTRIBUTION_BINS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DISTRIBUTION) + 0x3,
+    /*! \brief Indicates the width of a bin. Equal to the range divided by the number of bins. If the range is not a
+     * multiple of the number of bins, it is not valid. Read-only. Use a <tt>\ref vx_uint32</tt> parameter.  */
+    VX_DISTRIBUTION_WINDOW = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DISTRIBUTION) + 0x4,
+    /*! \brief Indicates the total size of the distribution in bytes. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_DISTRIBUTION_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DISTRIBUTION) + 0x5,
+};
+
+/*! \brief The Threshold types.
+ * \ingroup group_threshold
+ */
+enum vx_threshold_type_e {
+    /*! \brief A threshold with only 1 value. */
+    VX_THRESHOLD_TYPE_BINARY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_THRESHOLD_TYPE) + 0x0,
+    /*! \brief A threshold with 2 values (upper/lower). Use with Canny Edge Detection. */
+    VX_THRESHOLD_TYPE_RANGE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_THRESHOLD_TYPE) + 0x1,
+};
+
+/*! \brief The threshold attributes.
+ * \ingroup group_threshold
+ */
+enum vx_threshold_attribute_e {
+    /*! \brief The value type of the threshold. Read-only. Use a <tt>\ref vx_enum</tt> parameter. Will contain a <tt>\ref vx_threshold_type_e</tt>. */
+    VX_THRESHOLD_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x0,
+    /*! \brief The input image format the threshold was created for. Read-only. Use a <tt>\ref vx_enum</tt> parameter. Will contain a <tt>\ref vx_df_image_e</tt>.*/
+    VX_THRESHOLD_INPUT_FORMAT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x7,
+    /*! \brief The output image format the threshold was created for. Read-only. Use a <tt>\ref vx_enum</tt> parameter. Will contain a <tt>\ref vx_df_image_e</tt>.*/
+    VX_THRESHOLD_OUTPUT_FORMAT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x8
+};
+
+/*! \brief The matrix attributes.
+ * \ingroup group_matrix
+ */
+enum vx_matrix_attribute_e {
+    /*! \brief The value type of the matrix. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_MATRIX_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_MATRIX) + 0x0,
+    /*! \brief The M dimension of the matrix. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_MATRIX_ROWS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_MATRIX) + 0x1,
+    /*! \brief The N dimension of the matrix. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_MATRIX_COLUMNS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_MATRIX) + 0x2,
+    /*! \brief The total size of the matrix in bytes. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_MATRIX_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_MATRIX) + 0x3,
+    /*! \brief The origin of the matrix with a default value of [floor(VX_MATRIX_COLUMNS/2),
+         floor(VX_MATRIX_ROWS/2)]. Read-only. Use a <tt>\ref vx_coordinates2d_t</tt> parameter. */
+    VX_MATRIX_ORIGIN = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_MATRIX) + 0x4,
+    /*! \brief The pattern of the matrix. See <tt>\ref vx_pattern_e </tt>. Read-only. Use a
+     * <tt>\ref vx_enum</tt> parameter. If the matrix was created via <tt>\ref vxCreateMatrixFromPattern</tt>
+     * or <tt>\ref vxCreateMatrixFromPatternAndOrigin</tt>, the attribute corresponds to the given pattern.
+     * Otherwise the attribute is <tt>\ref VX_PATTERN_OTHER</tt>. */
+    VX_MATRIX_PATTERN = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_MATRIX) + 0x5,
+};
+
+/*! \brief The convolution attributes.
+ * \ingroup group_convolution
+ */
+enum vx_convolution_attribute_e {
+    /*! \brief The number of rows of the convolution matrix. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_CONVOLUTION_ROWS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONVOLUTION) + 0x0,
+    /*! \brief The number of columns of the convolution matrix. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_CONVOLUTION_COLUMNS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONVOLUTION) + 0x1,
+    /*! \brief The scale of the convolution matrix. Read-write. Use a <tt>\ref vx_uint32</tt> parameter.
+     * \if OPENVX_STRICT_1_0
+     * \note For 1.0, only powers of 2 are supported up to 2^31.
+     * \endif
+     */
+    VX_CONVOLUTION_SCALE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONVOLUTION) + 0x2,
+    /*! \brief The total size of the convolution matrix in bytes. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_CONVOLUTION_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONVOLUTION) + 0x3,
+};
+
+/*! \brief The pyramid object attributes.
+ * \ingroup group_pyramid
+ */
+enum vx_pyramid_attribute_e {
+    /*! \brief The number of levels of the pyramid. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_PYRAMID_LEVELS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x0,
+    /*! \brief The scale factor between each level of the pyramid. Read-only. Use a <tt>\ref vx_float32</tt> parameter. */
+    VX_PYRAMID_SCALE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x1,
+    /*! \brief The width of the 0th image in pixels. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_PYRAMID_WIDTH = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x2,
+    /*! \brief The height of the 0th image in pixels. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_PYRAMID_HEIGHT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x3,
+    /*! \brief The <tt>\ref vx_df_image_e</tt> format of the image. Read-only. Use a <tt>\ref vx_df_image</tt> parameter. */
+    VX_PYRAMID_FORMAT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_PYRAMID) + 0x4,
+};
+
+/*! \brief The remap object attributes.
+ * \ingroup group_remap
+ */
+enum vx_remap_attribute_e {
+    /*! \brief The source width. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_REMAP_SOURCE_WIDTH = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REMAP) + 0x0,
+    /*! \brief The source height. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_REMAP_SOURCE_HEIGHT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REMAP) + 0x1,
+    /*! \brief The destination width. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_REMAP_DESTINATION_WIDTH = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REMAP) + 0x2,
+    /*! \brief The destination height. Read-only. Use a <tt>\ref vx_uint32</tt> parameter. */
+    VX_REMAP_DESTINATION_HEIGHT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_REMAP) + 0x3,
+};
+
+/*! \brief The array object attributes.
+ * \ingroup group_array
+ */
+enum vx_array_attribute_e {
+    /*! \brief The type of the Array items. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_ARRAY_ITEMTYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_ARRAY) + 0x0,
+    /*! \brief The number of items in the Array. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_ARRAY_NUMITEMS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_ARRAY) + 0x1,
+    /*! \brief The maximal number of items that the Array can hold. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_ARRAY_CAPACITY = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_ARRAY) + 0x2,
+    /*! \brief Queries an array item size. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_ARRAY_ITEMSIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_ARRAY) + 0x3,
+};
+
+/*! \brief The ObjectArray object attributes.
+ * \ingroup group_object_array
+ */
+enum vx_object_array_attribute_e {
+    /*! \brief The type of the ObjectArray items. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_OBJECT_ARRAY_ITEMTYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_OBJECT_ARRAY) + 0x0,
+    /*! \brief The number of items in the ObjectArray. Read-only. Use a <tt>\ref vx_size</tt> parameter. */
+    VX_OBJECT_ARRAY_NUMITEMS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_OBJECT_ARRAY) + 0x1,
+};
+/*! \brief tensor Data attributes.
+ * \ingroup group_object_tensor
+ */
+enum vx_tensor_attribute_e
+{
+    /*! \brief Number of dimensions. */
+    VX_TENSOR_NUMBER_OF_DIMS = VX_ATTRIBUTE_BASE( VX_ID_KHRONOS, VX_TYPE_TENSOR ) + 0x0,
+    /*! \brief Dimension sizes. */
+    VX_TENSOR_DIMS        = VX_ATTRIBUTE_BASE( VX_ID_KHRONOS, VX_TYPE_TENSOR ) + 0x1,
+    /*! \brief tensor Data element data type. <tt>vx_type_e</tt> */
+    VX_TENSOR_DATA_TYPE   = VX_ATTRIBUTE_BASE( VX_ID_KHRONOS, VX_TYPE_TENSOR ) + 0x2,
+    /*! \brief fixed point position when the input element type is integer. */
+    VX_TENSOR_FIXED_POINT_POSITION = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_TENSOR) + 0x3,
+	/*! \brief bit width. */
+	//VX_TENSOR_BIT_WIDTH = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_TENSOR) + 0x4
+};
+
+/*! \brief The meta valid rectangle attributes.
+ * \ingroup group_user_kernels
+ */
+enum vx_meta_valid_rect_attribute_e {
+    /*! \brief Valid rectangle callback during output parameter validation. Write-only. */
+    VX_VALID_RECT_CALLBACK = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_META_FORMAT) + 0x1,
+};
+
+/*! \brief The channel enumerations for channel extractions.
+ * \see vxChannelExtractNode
+ * \see vxuChannelExtract
+ * \see VX_KERNEL_CHANNEL_EXTRACT
+ * \ingroup group_basic_features
+ */
+enum vx_channel_e {
+    /*! \brief Used by formats with unknown channel types. */
+    VX_CHANNEL_0 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x0,
+    /*! \brief Used by formats with unknown channel types. */
+    VX_CHANNEL_1 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x1,
+    /*! \brief Used by formats with unknown channel types. */
+    VX_CHANNEL_2 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x2,
+    /*! \brief Used by formats with unknown channel types. */
+    VX_CHANNEL_3 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x3,
+
+    /*! \brief Use to extract the RED channel, no matter the byte or packing order. */
+    VX_CHANNEL_R = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x10,
+    /*! \brief Use to extract the GREEN channel, no matter the byte or packing order. */
+    VX_CHANNEL_G = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x11,
+    /*! \brief Use to extract the BLUE channel, no matter the byte or packing order. */
+    VX_CHANNEL_B = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x12,
+    /*! \brief Use to extract the ALPHA channel, no matter the byte or packing order. */
+    VX_CHANNEL_A = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x13,
+    /*! \brief Use to extract the LUMA channel, no matter the byte or packing order. */
+    VX_CHANNEL_Y = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x14,
+    /*! \brief Use to extract the Cb/U channel, no matter the byte or packing order. */
+    VX_CHANNEL_U = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x15,
+    /*! \brief Use to extract the Cr/V/Value channel, no matter the byte or packing order. */
+    VX_CHANNEL_V = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_CHANNEL) + 0x16,
+};
+
+/*! \brief An enumeration of memory import types.
+ * \ingroup group_context
+ */
+enum vx_memory_type_e {
+    /*! \brief For memory allocated through OpenVX, this is the import type. */
+    VX_MEMORY_TYPE_NONE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_MEMORY_TYPE) + 0x0,
+
+    /*! \brief The default memory type to import from the Host. */
+    VX_MEMORY_TYPE_HOST = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_MEMORY_TYPE) + 0x1,
+
+    /*! \brief The default memory type to import from the Host. */
+    VX_MEMORY_TYPE_DEVICE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_MEMORY_TYPE) + 0x2,
+};
+
+/*! \brief The image reconstruction filters supported by image resampling operations.
+ *
+ * The edge of a pixel is interpreted as being aligned to the edge of the image.
+ * The value for an output pixel is evaluated at the center of that pixel.
+ *
+ * This means, for example, that an even enlargement of a factor of two in nearest-neighbor
+ * interpolation will replicate every source pixel into a 2x2 quad in the destination, and that
+ * an even shrink by a factor of two in bilinear interpolation will create each destination pixel
+ * by average a 2x2 quad of source pixels.
+ *
+ * Samples that cross the boundary of the source image have values determined by the border
+ * mode - see <tt>\ref vx_border_e</tt> and <tt>\ref VX_NODE_BORDER</tt>.
+ * \see vxuScaleImage
+ * \see vxScaleImageNode
+ * \see VX_KERNEL_SCALE_IMAGE
+ * \see vxuWarpAffine
+ * \see vxWarpAffineNode
+ * \see VX_KERNEL_WARP_AFFINE
+ * \see vxuWarpPerspective
+ * \see vxWarpPerspectiveNode
+ * \see VX_KERNEL_WARP_PERSPECTIVE
+ * \ingroup group_basic_features
+ */
+enum vx_interpolation_type_e {
+    /*! \brief Output values are defined to match the source pixel whose center is nearest to the sample position. */
+    VX_INTERPOLATION_NEAREST_NEIGHBOR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_INTERPOLATION) + 0x0,
+    /*! \brief Output values are defined by bilinear interpolation between the pixels whose centers are closest
+     * to the sample position, weighted linearly by the distance of the sample from the pixel centers. */
+    VX_INTERPOLATION_BILINEAR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_INTERPOLATION) + 0x1,
+    /*! \brief Output values are determined by averaging the source pixels whose areas fall under the
+     * area of the destination pixel, projected onto the source image. */
+    VX_INTERPOLATION_AREA = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_INTERPOLATION) + 0x2,
+};
+
+/*! \brief An enumeration of non-linear filter functions.
+ * \ingroup group_basic_features
+ */
+enum vx_non_linear_filter_e {
+    /*! \brief Nonlinear median filter. */
+    VX_NONLINEAR_FILTER_MEDIAN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NONLINEAR) + 0x0,
+    /*! \brief Nonlinear Erode. */
+    VX_NONLINEAR_FILTER_MIN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NONLINEAR) + 0x1 ,
+    /*! \brief Nonlinear Dilate. */
+    VX_NONLINEAR_FILTER_MAX = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NONLINEAR) + 0x2,
+};
+
+/*! \brief An enumeration of matrix patterns. See <tt>\ref vxCreateMatrixFromPattern </tt>
+ *  and <tt>\ref vxCreateMatrixFromPatternAndOrigin </tt>
+ * \ingroup group_basic_features
+ */
+enum vx_pattern_e {
+    /*! \brief Box pattern matrix */
+    VX_PATTERN_BOX = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_PATTERN) + 0x0,
+    /*! \brief Cross pattern matrix */
+    VX_PATTERN_CROSS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_PATTERN) + 0x1 ,
+    /*! \brief A square matrix (rows = columns = size) */
+    VX_PATTERN_DISK = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_PATTERN) + 0x2,
+    /*! \brief Matrix with any pattern other than above. */
+    VX_PATTERN_OTHER = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_PATTERN) + 0x3,
+};
+
+/*! \brief The image color space list used by the <tt>\ref VX_IMAGE_SPACE</tt> attribute of a <tt>\ref vx_image</tt>.
+ * \ingroup group_image
+ */
+enum vx_color_space_e {
+    /*! \brief Use to indicate that no color space is used. */
+    VX_COLOR_SPACE_NONE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_COLOR_SPACE) + 0x0,
+    /*! \brief Use to indicate that the BT.601 coefficients and SMPTE C primaries are used for conversions. */
+    VX_COLOR_SPACE_BT601_525 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_COLOR_SPACE) + 0x1,
+    /*! \brief Use to indicate that the BT.601 coefficients and BTU primaries are used for conversions. */
+    VX_COLOR_SPACE_BT601_625 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_COLOR_SPACE) + 0x2,
+    /*! \brief Use to indicate that the BT.709 coefficients are used for conversions. */
+    VX_COLOR_SPACE_BT709 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_COLOR_SPACE) + 0x3,
+
+    /*! \brief All images in VX are by default BT.709 */
+    VX_COLOR_SPACE_DEFAULT = VX_COLOR_SPACE_BT709,
+};
+
+/*! \brief The image channel range list used by the <tt>\ref VX_IMAGE_RANGE</tt> attribute of a <tt>\ref vx_image</tt>.
+ *  \ingroup group_image
+ */
+enum vx_channel_range_e {
+    /*! \brief Full range of the unit of the channel */
+    VX_CHANNEL_RANGE_FULL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_COLOR_RANGE) + 0x0,
+    /*! \brief Restricted range of the unit of the channel based on the space given */
+    VX_CHANNEL_RANGE_RESTRICTED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_COLOR_RANGE) + 0x1,
+};
+
+/*! \brief The parameter state type.
+ * \ingroup group_parameter
+ */
+enum vx_parameter_state_e {
+    /*! \brief Default. The parameter must be supplied. If not set, during
+     * Verify, an error is returned.
+     */
+    VX_PARAMETER_STATE_REQUIRED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_PARAMETER_STATE) + 0x0,
+    /*! \brief The parameter may be unspecified. The kernel takes care not
+     * to deference optional parameters until it is certain they are valid.
+     */
+    VX_PARAMETER_STATE_OPTIONAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_PARAMETER_STATE) + 0x1,
+};
+
+/*! \brief The border mode list.
+ * \ingroup group_borders
+ */
+enum vx_border_e {
+    /*! \brief No defined border mode behavior is given. */
+    VX_BORDER_UNDEFINED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_BORDER) + 0x0,
+    /*! \brief For nodes that support this behavior, a constant value is
+     * \e filled-in when accessing out-of-bounds pixels.
+     */
+    VX_BORDER_CONSTANT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_BORDER) + 0x1,
+    /*! \brief For nodes that support this behavior, a replication of the nearest
+     * edge pixels value is given for out-of-bounds pixels.
+     */
+    VX_BORDER_REPLICATE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_BORDER) + 0x2,
+};
+
+/*! \brief The unsupported border mode policy list.
+ * \ingroup group_borders
+ */
+enum vx_border_policy_e {
+    /*! \brief Use VX_BORDER_UNDEFINED instead of unsupported border modes. */
+    VX_BORDER_POLICY_DEFAULT_TO_UNDEFINED = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_BORDER_POLICY) + 0x0,
+    /*! \brief Return VX_ERROR_NOT_SUPPORTED for unsupported border modes. */
+    VX_BORDER_POLICY_RETURN_ERROR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_BORDER_POLICY) + 0x1,
+};
+
+/*! \brief The termination criteria list.
+ * \see group_vision_function_opticalflowpyrlk
+ * \ingroup group_context
+ */
+enum vx_termination_criteria_e {
+    /*! \brief Indicates a termination after a set number of iterations. */
+    VX_TERM_CRITERIA_ITERATIONS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TERM_CRITERIA) + 0x0,
+    /*! \brief Indicates a termination after matching against the value of eplison provided to the function. */
+    VX_TERM_CRITERIA_EPSILON = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TERM_CRITERIA) + 0x1,
+    /*! \brief Indicates that both an iterations and eplison method are employed. Whichever one matches first
+     * causes the termination.
+     */
+    VX_TERM_CRITERIA_BOTH = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_TERM_CRITERIA) + 0x2,
+};
+
+/*! \brief A normalization type.
+ * \see group_vision_function_canny
+ * \ingroup group_vision_function_canny
+ */
+enum vx_norm_type_e {
+    /*! \brief The L1 normalization. */
+    VX_NORM_L1 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NORM_TYPE) + 0x0,
+    /*! \brief The L2 normalization. */
+    VX_NORM_L2 = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NORM_TYPE) + 0x1,
+};
+
+/*! \brief The delay attribute list.
+ * \ingroup group_delay
+ */
+enum vx_delay_attribute_e {
+    /*! \brief The type of objects in the delay. Read-only. Use a <tt>\ref vx_enum</tt> parameter. */
+    VX_DELAY_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DELAY) + 0x0,
+    /*! \brief The number of items in the delay. Read-only. Use a <tt>\ref vx_size</tt> parameter.*/
+    VX_DELAY_SLOTS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_DELAY) + 0x1,
+};
+
+/*! \brief The memory accessor hint flags.
+ * These enumeration values are used to indicate desired \e system behavior,
+ * not the \b User intent. For example: these can be interpretted as hints to the
+ * system about cache operations or marshalling operations.
+ * \ingroup group_context
+ */
+enum vx_accessor_e {
+    /*! \brief The memory shall be treated by the system as if it were read-only.
+     * If the User writes to this memory, the results are implementation defined.
+     */
+    VX_READ_ONLY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACCESSOR) + 0x1,
+    /*! \brief The memory shall be treated by the system as if it were write-only.
+     * If the User reads from this memory, the results are implementation defined.
+     */
+    VX_WRITE_ONLY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACCESSOR) + 0x2,
+    /*! \brief The memory shall be treated by the system as if it were readable and writeable.
+     */
+    VX_READ_AND_WRITE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ACCESSOR) + 0x3,
+};
+
+/*! \brief The Round Policy Enumeration.
+ * \ingroup group_context
+ */
+enum vx_round_policy_e {
+    /*! \brief When scaling, this truncates the least significant values that are lost in operations. */
+    VX_ROUND_POLICY_TO_ZERO = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ROUND_POLICY) + 0x1,
+    /*! \brief When scaling, this rounds to nearest even output value. */
+    VX_ROUND_POLICY_TO_NEAREST_EVEN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_ROUND_POLICY) + 0x2,
+};
+
+/*! \brief Local binary pattern supported.
+ * \ingroup group_vision_function_lbp
+ */
+enum vx_lbp_format_e
+{
+    /*! \brief local binary pattern
+	*/
+    VX_LBP  = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_LBP_FORMAT ) + 0x0,
+    /*! \brief Modified Local Binary Patterns
+	*/
+
+    VX_MLBP = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_LBP_FORMAT ) + 0x1,
+    /*! \brief Uniform local binary pattern
+	*/
+    VX_ULBP = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_LBP_FORMAT ) + 0x2
+};
+
+/*! \brief comparing metrics.
+ * \details In all the equations below w and h are width and height of the template image respectively.
+ * \f$ R \f$ is the compare map. \f$ T \f$ is the template image.\f$ I \f$ is the image on which the template is searched.
+ * \ingroup group_vision_function_match_template
+ */
+enum vx_comp_metric_e
+{
+    /*! \brief hamming distance \f$ R(x,y) = \frac{1}{w*h}\sum_{\grave{x},\grave{y}}^{w,h} XOR(T(\grave{x},\grave{y}),I(x+\grave{x},y+\grave{y}))\f$ */
+    VX_COMPARE_HAMMING    = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x0,
+    /*! \brief L1 distance \f$ R(x,y) = \frac{1}{w*h}\sum_{\grave{x},\grave{y}}^{w,h} ABS(T(\grave{x},\grave{y}) - I(x+\grave{x},y+\grave{y}))\f$ */
+    VX_COMPARE_L1         = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x1,
+    /*! \brief L2 distance normalized by image size \f$ R(x,y) = \frac{1}{w*h}\sum_{\grave{x},\grave{y}}^{w,h} (T(\grave{x},\grave{y}) - I(x+\grave{x},y+\grave{y}))^2\f$*/
+    VX_COMPARE_L2         = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x2,
+    /*! \brief cross correlation distance \f$ R(x,y) = \frac{1}{w*h}\sum_{\grave{x},\grave{y}}^{w,h} (T(\grave{x},\grave{y})*I(x+\grave{x},y+\grave{y}))\f$*/
+    VX_COMPARE_CCORR      = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x3,
+    /*! \brief L2 normalized distance \f$ R(x,y) = \frac{\sum_{\grave{x},\grave{y}}^{w,h} (T(\grave{x},\grave{y}) - I(x+\grave{x},y+\grave{y}))^2}
+	 * {\sqrt{\sum_{\grave{x},\grave{y}}^{w,h} T(\grave{x},\grave{y})^2 * I(x+\grave{x},y+\grave{y})^2}} \f$*/
+    VX_COMPARE_L2_NORM    = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x4,
+    /*! \brief cross correlation normalized distance \f$ R(x,y) = \frac{\sum_{\grave{x},\grave{y}}^{w,h} T(\grave{x},\grave{y}) * I(x+\grave{x},y+\grave{y})*2^{15}}
+	 * {\sqrt{\sum_{\grave{x},\grave{y}}^{w,h} T(\grave{x},\grave{y})^2 * I(x+\grave{x},y+\grave{y})^2}} \f$*/
+    VX_COMPARE_CCORR_NORM = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x5
+};
+
+#if defined(_WIN32) || defined(UNDER_CE)
+#if defined(_WIN64)
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_REF  "%I64u"
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_SIZE "%I64u"
+#else
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_REF  "%lu"
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_SIZE "%lu"
+#endif
+#else
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_REF  "%p"
+/*! \brief Use to aid in debugging values in OpenVX.
+ * \ingroup group_basic_features
+ */
+#define VX_FMT_SIZE "%zu"
+#endif
+/*! \brief Use to indicate the 1:1 ratio in Q22.10 format.
+ * \ingroup group_basic_features
+ */
+#define VX_SCALE_UNITY (1024u)
+
+/*!
+ * \brief The addressing image patch structure is used by the Host only
+ * to address pixels in an image patch. The fields of the structure are defined as:
+ * \arg dim - The dimensions of the image in logical pixel units in the x & y direction.
+ * \arg stride - The physical byte distance from a logical pixel to the next
+ * logically adjacent pixel in the positive x or y direction.
+ * \arg scale - The relationship of scaling from the primary plane (typically
+ * the zero indexed plane) to this plane. An integer down-scaling factor of \f$ f \f$ shall be
+ * set to a value equal to \f$ scale = \frac{unity}{f} \f$ and an integer up-scaling factor of \f$ f \f$
+ * shall be set to a value of \f$ scale = unity * f \f$. \f$ unity \f$ is defined as <tt>\ref VX_SCALE_UNITY</tt>.
+ * \arg step - The step is the number of logical pixel units to skip to
+ * arrive at the next physically unique pixel. For example, on a plane that is
+ * half-scaled in a dimension, the step in that dimension is 2 to indicate that
+ * every other pixel in that dimension is an alias. This is useful in situations
+ * where iteration over unique pixels is required, such as in serializing
+ * or de-serializing the image patch information.
+ * \see <tt>\ref vxMapImagePatch</tt>
+ * \ingroup group_image
+ */
+typedef struct _vx_imagepatch_addressing_t {
+    vx_uint32 dim_x;        /*!< \brief Width of patch in X dimension in pixels. */
+    vx_uint32 dim_y;        /*!< \brief Height of patch in Y dimension in pixels. */
+    vx_int32  stride_x;     /*!< \brief Stride in X dimension in bytes. */
+    vx_int32  stride_y;     /*!< \brief Stride in Y dimension in bytes. */
+    vx_uint32 scale_x;      /*!< \brief Scale of X dimension. For sub-sampled planes this is the scaling factor of the dimension of the plane in relation to the zero plane. Use <tt>\ref VX_SCALE_UNITY</tt> in the numerator. */
+    vx_uint32 scale_y;      /*!< \brief Scale of Y dimension. For sub-sampled planes this is the scaling factor of the dimension of the plane in relation to the zero plane. Use <tt>\ref VX_SCALE_UNITY</tt> in the numerator.  */
+    vx_uint32 step_x;       /*!< \brief Step of X dimension in pixels. */
+    vx_uint32 step_y;       /*!< \brief Step of Y dimension in pixels. */
+} vx_imagepatch_addressing_t;
+
+/*! \brief Use to initialize a <tt>\ref vx_imagepatch_addressing_t</tt> structure on the stack.
+ * \ingroup group_image
+ */
+#define VX_IMAGEPATCH_ADDR_INIT {0u, 0u, 0, 0, 0u, 0u, 0u, 0u}
+
+/*! \brief The performance measurement structure. The time or durations are in units of nano seconds.
+ * \ingroup group_performance
+ */
+typedef struct _vx_perf_t {
+    vx_uint64 tmp;          /*!< \brief Holds the last measurement. */
+    vx_uint64 beg;          /*!< \brief Holds the first measurement in a set. */
+    vx_uint64 end;          /*!< \brief Holds the last measurement in a set. */
+    vx_uint64 sum;          /*!< \brief Holds the summation of durations. */
+    vx_uint64 avg;          /*!< \brief Holds the average of the durations. */
+    vx_uint64 min;          /*!< \brief Holds the minimum of the durations. */
+    vx_uint64 num;          /*!< \brief Holds the number of measurements. */
+    vx_uint64 max;          /*!< \brief Holds the maximum of the durations. */
+} vx_perf_t;
+
+/*! \brief Hough lines probability parameters.
+ * \ingroup group_vision_function_hough_lines_p
+ */
+typedef struct _vx_hough_lines_p_t
+{
+    /*! \brief  Distance resolution of the parameter in pixels. */
+    vx_float32 rho;
+    /*! \brief Angle resolution of the parameter in radians. */
+    vx_float32 theta;
+    /*! \brief The minimum number of intersections to detect a line. */
+    vx_int32 threshold;
+    /*! \brief The minimum number of points that can form a line. Line segments shorter than that are rejected. */
+    vx_int32 line_length;
+    /*! \brief The maximum allowed gap between points on the same line to link them. */
+    vx_int32 line_gap;
+    /*! \brief Optional restriction on theta. The max allowed value. */
+    vx_float32 theta_max;
+    /*! \brief Optional restriction on theta. The min allowed value. */
+    vx_float32 theta_min;
+} vx_hough_lines_p_t;
+
+/*! \brief line struct
+ * \ingroup group_basic_features
+ */
+typedef struct _vx_line2d_t
+{
+    /*! \brief x index of line start */
+    vx_float32 start_x;
+    /*! \brief y index of line start */
+    vx_float32 start_y;
+    /*! \brief x index of line end*/
+    vx_float32 end_x;
+    /*! \brief y index of line end*/
+    vx_float32 end_y;
+} vx_line2d_t;
+
+/*! \brief Matrix Multiply Parameters
+ *
+ * transpose_input1/input2/input3 : if True the matrix is transposed before the operation, otherwise the matrix is used as is. \n
+ * \ingroup group_vision_function_tensor_matrix_multiply
+ */
+typedef struct _vx_tensor_matrix_multiply_params_t{
+	/*! \brief if True the matrix is transposed before the operation, otherwise the matrix is used as is*/
+	vx_bool  transpose_input1;
+	/*! \brief if True the matrix is transposed before the operation, otherwise the matrix is used as is*/
+	vx_bool  transpose_input2;
+	/*! \brief if True the matrix is transposed before the operation, otherwise the matrix is used as is*/
+	vx_bool  transpose_input3;
+} vx_tensor_matrix_multiply_params_t;
+
+/*! \brief Initializes a <tt>\ref vx_perf_t</tt> on the stack.
+ * \ingroup group performance
+ */
+#define VX_PERF_INIT    {0ul, 0ul, 0ul, 0ul, 0ul, 0ul}
+
+/*! \brief The Kernel Information Structure. This is returned by the Context
+ * to indicate which kernels are available in the OpenVX implementation.
+ * \ingroup group_kernel
+ */
+typedef struct _vx_kernel_info_t {
+    /*! \brief The kernel enumeration value from <tt>\ref vx_kernel_e</tt> (or an
+     * extension thereof).
+     * \see vxGetKernelByEnum
+     */
+    vx_enum enumeration;
+
+    /*! \brief The kernel name in dotted hierarchical format.
+     * e.g. "org.khronos.openvx.sobel_3x3"
+     * \see vxGetKernelByName
+     */
+    vx_char name[VX_MAX_KERNEL_NAME];
+} vx_kernel_info_t;
+
+/*! \brief Use to indicate a half-scale pyramid.
+ * \ingroup group_pyramid
+ */
+#define VX_SCALE_PYRAMID_HALF       (0.5f)
+
+/*! \brief Use to indicate a ORB scaled pyramid whose scaling factor is \f$ \frac{1}{\root 4 \of {2}} \f$.
+ * \ingroup group_pyramid
+ */
+#define VX_SCALE_PYRAMID_ORB        ((vx_float32)0.8408964f)
+
+/*! \brief The keypoint data structure.
+ * \ingroup group_basic_features
+ */
+typedef struct _vx_keypoint_t {
+    vx_int32 x;                 /*!< \brief The x coordinate. */
+    vx_int32 y;                 /*!< \brief The y coordinate. */
+    vx_float32 strength;        /*!< \brief The strength of the keypoint. Its definition is specific to the corner detector. */
+    vx_float32 scale;           /*!< \brief Initialized to 0 by corner detectors. */
+    vx_float32 orientation;     /*!< \brief Initialized to 0 by corner detectors. */
+    vx_int32 tracking_status;   /*!< \brief A zero indicates a lost point. Initialized to 1 by corner detectors. */
+    vx_float32 error;           /*!< \brief A tracking method specific error. Initialized to 0 by corner detectors. */
+} vx_keypoint_t;
+
+/*! \brief The rectangle data structure that is shared with the users. The area of the rectangle can be computed as (end_x-start_x)*(end_y-start_y).
+ * \ingroup group_basic_features
+ */
+typedef struct _vx_rectangle_t {
+    vx_uint32 start_x;          /*!< \brief The Start X coordinate. */
+    vx_uint32 start_y;          /*!< \brief The Start Y coordinate. */
+    vx_uint32 end_x;            /*!< \brief The End X coordinate. */
+    vx_uint32 end_y;            /*!< \brief The End Y coordinate. */
+} vx_rectangle_t;
+
+/*! \brief The 2D Coordinates structure.
+ * \ingroup group_basic_features
+ */
+typedef struct _vx_coordinates2d_t {
+    vx_uint32 x;    /*!< \brief The X coordinate. */
+    vx_uint32 y;    /*!< \brief The Y coordinate. */
+} vx_coordinates2d_t;
+
+/*! \brief The floating-point 2D Coordinates structure.
+ * \ingroup group_basic_features
+ */
+typedef struct _vx_coordinates2df_t {
+    vx_float32 x;    /*!< \brief The X coordinate. */
+    vx_float32 y;    /*!< \brief The Y coordinate. */
+} vx_coordinates2df_t;
+
+/*! \brief The 3D Coordinates structure.
+ * \ingroup group_basic_features
+ */
+typedef struct _vx_coordinates3d_t {
+    vx_uint32 x;    /*!< \brief The X coordinate. */
+    vx_uint32 y;    /*!< \brief The Y coordinate. */
+    vx_uint32 z;    /*!< \brief The Z coordinate. */
+} vx_coordinates3d_t;
+
+/*! \brief Union that describes the value of a pixel for any image format. Use the field
+* corresponding to the image format.
+* \ingroup group_image
+*/
+typedef union _vx_pixel_value_t {
+    vx_uint8 RGB[3]; /*!< \brief <tt>\ref VX_DF_IMAGE_RGB</tt> format in the R,G,B order */
+    vx_uint8 RGBX[4]; /*!< \brief <tt>\ref VX_DF_IMAGE_RGBX</tt> format in the R,G,B,X order */
+    vx_uint8 YUV[3]; /*!< \brief All YUV formats in the Y,U,V order */
+    vx_uint8 U8; /*!< \brief <tt>\ref VX_DF_IMAGE_U8</tt> */
+    vx_uint16 U16; /*!< \brief <tt>\ref VX_DF_IMAGE_U16</tt> */
+    vx_int16 S16; /*!< \brief <tt>\ref VX_DF_IMAGE_S16</tt> */
+    vx_uint32 U32; /*!< \brief <tt>\ref VX_DF_IMAGE_U32</tt> */
+    vx_int32 S32; /*!< \brief <tt>\ref VX_DF_IMAGE_S32</tt> */
+    vx_uint8 reserved[16];
+} vx_pixel_value_t;
+
+/*! \brief The HOG descriptor structure.
+ * \ingroup group_vision_function_hog
+ */
+typedef struct {
+    /*! \brief   The histogram cell width of type <tt>\ref VX_TYPE_INT32</tt>.*/
+    vx_int32 cell_width;
+    /*! \brief   The histogram cell height of type <tt>\ref VX_TYPE_INT32</tt>.*/
+    vx_int32 cell_height;
+    /*! \brief  The histogram block width of type <tt>\ref VX_TYPE_INT32</tt>.  Must be divisible by cell_width. */
+    vx_int32 block_width;
+    /*! \brief  The histogram block height of type <tt>\ref VX_TYPE_INT32</tt>.  Must be divisible by cell_height. */
+    vx_int32 block_height;
+    /*! \brief  The histogram block stride within the window of type <tt>\ref VX_TYPE_INT32</tt>.  Must be an integral number of cell_width and cell_height.*/
+    vx_int32 block_stride;
+    /*! \brief  The histogram size of type <tt>\ref VX_TYPE_INT32</tt>.*/
+    vx_int32 num_bins;
+    /*! \brief  The feature descriptor window width of type <tt>\ref VX_TYPE_INT32</tt>*/
+    vx_int32 window_width;
+    /*! \brief  The feature descriptor window height of type <tt>\ref VX_TYPE_INT32</tt>*/
+    vx_int32 window_height;
+    /*! \brief The feature descriptor window stride of type <tt>\ref VX_TYPE_INT32</tt>*/
+    vx_int32 window_stride;
+     /*! \brief The threshold for the maximum L2-norm value for a histogram bin.  It is used as part of block normalization.  It defaults to 0.2. */
+    vx_float32 threshold;
+} vx_hog_t;
+
+/*! \brief Use with the enumeration <tt>\ref VX_NODE_BORDER</tt> to set the
+* border mode behavior of a node that supports borders.
+*
+* If the indicated border mode is not supported, an error <tt>\ref VX_ERROR_NOT_SUPPORTED</tt> will be reported
+* either at the time the <tt>\ref VX_NODE_BORDER</tt> is set or at the time of graph verification.
+* \ingroup group_borders
+*/
+typedef struct _vx_border_t {
+    /*! \brief See <tt>\ref vx_border_e</tt>. */
+    vx_enum mode;
+    /*! \brief For the mode <tt>\ref VX_BORDER_CONSTANT</tt>, this union contains the
+    * value of out-of-bound pixels.
+    */
+    vx_pixel_value_t constant_value;
+} vx_border_t;
+
+/*!
+* \brief The type of the <tt>vxPublishKernels</tt> entry function of modules loaded
+* by <tt>\ref vxLoadKernels</tt> and unloaded by <tt>\ref vxUnloadKernels</tt>.
+* \param [in] context The reference to the context kernels must be added to.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_API_CALL *vx_publish_kernels_f)(vx_context context);
+
+/*!
+* \brief The type of the <tt>vxUnpublishKernels</tt> entry function of modules loaded
+* by <tt>\ref vxLoadKernels</tt> and unloaded by <tt>\ref vxUnloadKernels</tt>.
+* \param [in] context The reference to the context kernels have been added to.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_API_CALL *vx_unpublish_kernels_f)(vx_context context);
+
+/*!
+* \brief The pointer to the Host side kernel.
+* \param [in] node The handle to the node that contains this kernel.
+* \param [in] parameters The array of parameter references.
+* \param [in] num The number of parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_f)(vx_node node, const vx_reference *parameters, vx_uint32 num);
+
+/*!
+* \brief The pointer to the kernel initializer. If the host code requires a call
+* to initialize data once all the parameters have been validated, this function is called
+* if not NULL.
+* \param [in] node The handle to the node that contains this kernel.
+* \param [in] parameters The array of parameter references.
+* \param [in] num The number of parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_initialize_f)(vx_node node, const vx_reference *parameters, vx_uint32 num);
+
+/*!
+* \brief The pointer to the kernel deinitializer. If the host code requires a call
+* to deinitialize data during a node garbage collection, this function is called
+* if not NULL.
+* \param [in] node The handle to the node that contains this kernel.
+* \param [in] parameters The array of parameter references.
+* \param [in] num The number of parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_deinitialize_f)(vx_node node, const vx_reference *parameters, vx_uint32 num);
+
+typedef vx_status(VX_CALLBACK *vx_kernel_dump_f)(vx_node node, const vx_reference * parameters, vx_uint32 num, void * info_file);
+
+/*!
+* \brief The user-defined kernel node parameters validation function. The function only
+* needs to fill in the meta data structure(s).
+* \note This function is called once for whole set of parameters.
+* \param [in] node The handle to the node that is being validated.
+* \param [in] parameters The array of parameters to be validated.
+* \param [in] num Number of parameters to be validated.
+* \param [in] metas A pointer to a pre-allocated array of structure references that the system holds.
+* The system pre-allocates a number of vx_meta_format structures for the output parameters only,
+* indexed by the same indices as parameters[]. The validation function fills in the correct type, format,
+* and dimensionality for the system to use either to create memory or to check against existing memory.
+* \return An error code describing the validation status on parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_validate_f)(vx_node node, const vx_reference parameters[], vx_uint32 num, vx_meta_format metas[]);
+
+/*!
+* \brief A user-defined callback function to set the valid rectangle of an output image.
+*
+* The <tt>\ref VX_VALID_RECT_CALLBACK</tt> attribute in the <tt>\ref vx_meta_format</tt> object should be
+* set to the desired callback during user node's output validator. The callback must not call
+* <tt>\ref vxGetValidRegionImage</tt> or <tt>\ref vxSetImageValidRectangle</tt>.  Instead, an array of the
+* valid rectangles of all the input images is supplied to the callback to calculate the output
+* valid rectangle. The output of the user node may be a pyramid, or just an image.  If it is just an
+* image, the 'Out' array associated with that output only has one element.  If the output is a
+* pyramid, the array size is equal to the number of pyramid levels. Notice that the array memory
+* allocation passed to the callback is managed by the framework, the application must not allocate or
+* deallocate those pointers.
+*
+* The behavior of the callback function vx_kernel_image_valid_rectangle_f is undefined
+* if one of the following is true:
+* - One of the input arguments of a user node is a pyramid or an array of images.
+* - Either input or output argument of a user node is an array of pyramids.
+*
+* \param [in,out] node The handle to the node that is being validated.
+* \param [in] index The index of the output parameter for which a valid region should be set.
+* \param [in] input_valid A pointer to an array of valid regions of input images or images
+* contained in image container (e.g. pyramids). They are provided in same order as the parameter
+* list of the kernel's declaration.
+* \param [out] output_valid An array of valid regions that should be set for the output images or
+* image containers (e.g. pyramid) after graph processing. The length of the array should be equal
+* to the size of the image container (e.g. number of levels in the pyramid). For a simple output
+* image the array size is always one. Each rectangle supplies the valid region for one image. The
+* array memory allocation is managed by the framework.
+* \return An error code describing the validation status on parameters.
+* \ingroup group_user_kernels
+*/
+typedef vx_status(VX_CALLBACK *vx_kernel_image_valid_rectangle_f)(vx_node node, vx_uint32 index, const vx_rectangle_t* const input_valid[], vx_rectangle_t* const output_valid[]);
+
+/*! \brief The log callback function.
+ * \ingroup group_log
+ */
+typedef void (VX_CALLBACK *vx_log_callback_f)(vx_context context,
+                                  vx_reference ref,
+                                  vx_status status,
+                                  const vx_char string[]);
+
+/*! \brief The Map/Unmap operation enumeration.
+ * \ingroup group_image
+ */
+enum vx_map_flag_e {
+     VX_NOGAP_X = 1,  /*!< \brief No Gap. */
+};
+
+#endif

+ 67 - 0
include_bakbak/VX/vx_vendors.h

@@ -0,0 +1,67 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_VENDORS_H_
+#define _OPENVX_VENDORS_H_
+
+/*!
+ * \file
+ * \brief The Vendor ID list for OpenVX.
+ */
+
+/*! \brief The Vendor ID of the Implementation. As new vendors submit their
+ * implementations, this enumeration will grow.
+ * \ingroup group_basic_features
+ */
+enum vx_vendor_id_e {
+    VX_ID_KHRONOS   = 0x000, /*!< \brief The Khronos Group */
+    VX_ID_TI        = 0x001, /*!< \brief Texas Instruments, Inc. */
+    VX_ID_QUALCOMM  = 0x002, /*!< \brief Qualcomm, Inc. */
+    VX_ID_NVIDIA    = 0x003, /*!< \brief NVIDIA Corporation */
+    VX_ID_ARM       = 0x004, /*!< \brief ARM Ltd. */
+    VX_ID_BDTI      = 0x005, /*!< \brief Berkley Design Technology, Inc. */
+    VX_ID_RENESAS   = 0x006, /*!< \brief Renasas Electronics */
+    VX_ID_VIVANTE   = 0x007, /*!< \brief Vivante Corporation */
+    VX_ID_XILINX    = 0x008, /*!< \brief Xilinx Inc. */
+    VX_ID_AXIS      = 0x009, /*!< \brief Axis Communications */
+    VX_ID_MOVIDIUS  = 0x00A, /*!< \brief Movidius Ltd. */
+    VX_ID_SAMSUNG   = 0x00B, /*!< \brief Samsung Electronics */
+    VX_ID_FREESCALE = 0x00C, /*!< \brief Freescale Semiconductor */
+    VX_ID_AMD       = 0x00D, /*!< \brief Advanced Micro Devices */
+    VX_ID_BROADCOM  = 0x00E, /*!< \brief Broadcom Corporation */
+    VX_ID_INTEL     = 0x00F, /*!< \brief Intel Corporation */
+    VX_ID_MARVELL   = 0x010, /*!< \brief Marvell Technology Group Ltd. */
+    VX_ID_MEDIATEK  = 0x011, /*!< \brief MediaTek, Inc. */
+    VX_ID_ST        = 0x012, /*!< \brief STMicroelectronics */
+    VX_ID_CEVA      = 0x013, /*!< \brief CEVA DSP */
+    VX_ID_ITSEEZ    = 0x014, /*!< \brief Itseez, Inc. */
+    VX_ID_IMAGINATION=0x015, /*!< \brief Imagination Technologies */
+    VX_ID_NXP       = 0x016, /*!< \brief NXP Semiconductors */
+    VX_ID_VIDEANTIS = 0x017, /*!< \brief Videantis */
+    VX_ID_SYNOPSYS  = 0x018, /*!< \brief Synopsys */
+    VX_ID_CADENCE   = 0x019, /*!< \brief Cadence */
+    VX_ID_HUAWEI    = 0x01A, /*!< \brief Huawei */
+    VX_ID_SOCIONEXT = 0x01B, /*!< \brief Socionext */
+    /* Add new vendor code above this line */
+    VX_ID_USER      = 0xFFE, /*!< \brief For use by vxAllocateUserKernelId and vxAllocateUserKernelLibraryId */
+    VX_ID_MAX       = 0xFFF,
+    /*! \brief For use by all Kernel authors until they can obtain an assigned ID. */
+    VX_ID_DEFAULT = VX_ID_MAX,
+};
+
+#endif
+

+ 946 - 0
include_bakbak/VX/vxu.h

@@ -0,0 +1,946 @@
+/*
+
+ * Copyright (c) 2012-2017 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _OPENVX_UTILITY_H_
+#define _OPENVX_UTILITY_H_
+
+/*!
+ * \file
+ * \brief The OpenVX Utility Library.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief [Immediate] Invokes an immediate Color Conversion.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image.
+ * \param [out] output The output image.
+ * \ingroup group_vision_function_colorconvert
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuColorConvert(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Invokes an immediate Channel Extract.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image. Must be one of the defined <tt>\ref vx_df_image_e</tt> multi-channel formats.
+ * \param [in] channel The <tt>\ref vx_channel_e</tt> enumeration to extract.
+ * \param [out] output The output image. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \ingroup group_vision_function_channelextract
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuChannelExtract(vx_context context, vx_image input, vx_enum channel, vx_image output);
+
+/*! \brief [Immediate] Invokes an immediate Channel Combine.
+ * \param [in] context The reference to the overall context.
+ * \param [in] plane0 The plane that forms channel 0. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] plane1 The plane that forms channel 1. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] plane2 [optional] The plane that forms channel 2. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] plane3 [optional] The plane that forms channel 3. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [out] output The output image.
+ * \ingroup group_vision_function_channelcombine
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuChannelCombine(vx_context context, vx_image plane0, vx_image plane1, vx_image plane2, vx_image plane3, vx_image output);
+
+/*! \brief [Immediate] Invokes an immediate Sobel 3x3.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output_x [optional] The output gradient in the x direction in <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [out] output_y [optional] The output gradient in the y direction in <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \ingroup group_vision_function_sobel3x3
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuSobel3x3(vx_context context, vx_image input, vx_image output_x, vx_image output_y);
+
+/*! \brief [Immediate] Invokes an immediate Magnitude.
+ * \param [in] context The reference to the overall context.
+ * \param [in] grad_x The input x image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] grad_y The input y image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] mag The magnitude image. This will be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \ingroup group_vision_function_magnitude
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuMagnitude(vx_context context, vx_image grad_x, vx_image grad_y, vx_image mag);
+
+/*! \brief [Immediate] Invokes an immediate Phase.
+ * \param [in] context The reference to the overall context.
+ * \param [in] grad_x The input x image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] grad_y The input y image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] orientation The phase image. This will be in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \ingroup group_vision_function_phase
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuPhase(vx_context context, vx_image grad_x, vx_image grad_y, vx_image orientation);
+
+/*! \brief [Immediate] Scales an input image to an output image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] src The source image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [out] dst The destintation image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] type The interpolation type. \see vx_interpolation_type_e.
+ * \ingroup group_vision_function_scale_image
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuScaleImage(vx_context context, vx_image src, vx_image dst, vx_enum type);
+
+/*! \brief [Immediate] Processes the image through the LUT.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] lut The LUT which is of type <tt>\ref VX_TYPE_UINT8</tt> if input image is <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_TYPE_INT16</tt> if input image is <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [out] output The output image of the same type as the input image.
+ * \ingroup group_vision_function_lut
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuTableLookup(vx_context context, vx_image input, vx_lut lut, vx_image output);
+
+/*! \brief [Immediate] Generates a distribution from an image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt>
+ * \param [out] distribution The output distribution.
+ * \ingroup group_vision_function_histogram
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuHistogram(vx_context context, vx_image input, vx_distribution distribution);
+
+/*! \brief [Immediate] Equalizes the Histogram of a grayscale image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The grayscale input image in <tt>\ref VX_DF_IMAGE_U8</tt>
+ * \param [out] output The grayscale output image of type <tt>\ref VX_DF_IMAGE_U8</tt> with equalized brightness and contrast.
+ * \ingroup group_vision_function_equalize_hist
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuEqualizeHist(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Computes the absolute difference between two images.
+ * \param [in] context The reference to the overall context.
+ * \param [in] in1 An input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] in2 An input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \ingroup group_vision_function_absdiff
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuAbsDiff(vx_context context, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Immediate] Computes the mean value and optionally the standard deviation.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image. <tt>\ref VX_DF_IMAGE_U8</tt> is supported.
+ * \param [out] mean The average pixel value.
+ * \param [out] stddev [optional] The standard deviation of the pixel values.
+ * \ingroup group_vision_function_meanstddev
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuMeanStdDev(vx_context context, vx_image input, vx_float32 *mean, vx_float32 *stddev);
+
+/*! \brief [Immediate] Threshold's an input image and produces a <tt>\ref VX_DF_IMAGE_U8</tt> boolean image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image. Only images with format <tt>\ref VX_DF_IMAGE_U8</tt>
+ * and <tt>\ref VX_DF_IMAGE_S16</tt> are supported.
+ * \param [in] thresh The thresholding object that defines the parameters of
+ * the operation. The <tt>\ref VX_THRESHOLD_INPUT_FORMAT</tt> must be the same as the input image format and
+ * the <tt>\ref VX_THRESHOLD_OUTPUT_FORMAT</tt> must be the same as the output image format.
+ * \param [out] output The output image, that will contain as pixel value
+ * true and false values defined by \p thresh. Only images with format
+ * <tt>\ref VX_DF_IMAGE_U8</tt> are supported.
+ * \ingroup group_vision_function_threshold
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuThreshold(vx_context context, vx_image input, vx_threshold thresh, vx_image output);
+
+/*! \brief [Immediate] Performs Non-Maxima Suppression on an image, producing an image of the same type.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] mask [optional] Constrict suppression to a ROI. The mask image is of type <tt>\ref VX_DF_IMAGE_U8</tt> and must be the same dimensions as the input image.
+ * \param [in] win_size The size of window over which to perform the localized non-maxima suppression.  Must be odd, and less than or equal to the smallest dimension of the input image.
+ * \param [out] output The output image, of the same type as the input, that has been non-maxima suppressed.
+ * \ingroup group_vision_function_nms
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuNonMaxSuppression(vx_context context, vx_image input, vx_image mask, vx_int32 win_size, vx_image output);
+
+/*! \brief [Immediate] Computes the integral image of the input.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U32</tt> format.
+ * \ingroup group_vision_function_integral_image
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuIntegralImage(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Erodes an image by a 3x3 window.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \ingroup group_vision_function_erode_image
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuErode3x3(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Dilates an image by a 3x3 window.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \ingroup group_vision_function_dilate_image
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuDilate3x3(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Computes a median filter on the image by a 3x3 window.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \ingroup group_vision_function_median_image
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuMedian3x3(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Computes a box filter on the image by a 3x3 window.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \ingroup group_vision_function_box_image
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuBox3x3(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Computes a gaussian filter on the image by a 3x3 window.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \ingroup group_vision_function_gaussian_image
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuGaussian3x3(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Performs Non-linear Filtering.
+ * \param [in] context The reference to the overall context.
+ * \param [in] function The non-linear filter function. See <tt>\ref vx_non_linear_filter_e</tt>.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [in] mask The mask to be applied to the Non-linear function. <tt>\ref VX_MATRIX_ORIGIN</tt> attribute is used
+ * to place the mask appropriately when computing the resulting image. See <tt>\ref vxCreateMatrixFromPattern</tt> and <tt>\ref vxCreateMatrixFromPatternAndOrigin</tt>.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ * \ingroup group_vision_function_nonlinear_filter
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuNonLinearFilter(vx_context context, vx_enum function, vx_image input, vx_matrix mask, vx_image output);
+
+
+/*! \brief [Immediate] Computes a convolution on the input image with the supplied
+ * matrix.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
+ * \param [in] conv The <tt>\ref vx_int16</tt> convolution matrix.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \ingroup group_vision_function_custom_convolution
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuConvolve(vx_context context, vx_image input, vx_convolution conv, vx_image output);
+
+/*! \brief [Immediate] Computes a Gaussian pyramid from an input image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt>
+ * \param [out] gaussian The Gaussian pyramid with <tt>\ref VX_DF_IMAGE_U8</tt> to construct.
+ * \ingroup group_vision_function_gaussian_pyramid
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuGaussianPyramid(vx_context context, vx_image input, vx_pyramid gaussian);
+
+/*! \brief [Immediate] Computes a Laplacian pyramid from an input image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] laplacian The Laplacian pyramid with <tt>\ref VX_DF_IMAGE_S16</tt> to construct.
+ * \param [out] output The lowest resolution image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format necessary to reconstruct the input image from the pyramid. The output image format should be same as input image format.
+ * \ingroup group_vision_function_laplacian_pyramid
+ * \see group_pyramid
+ * \return A <tt>\ref vx_status</tt> enumeration.
+ * \retval VX_SUCCESS Success.
+ * \retval * An error occured. See <tt>\ref vx_status_e</tt>
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuLaplacianPyramid(vx_context context, vx_image input, vx_pyramid laplacian, vx_image output);
+
+/*! \brief [Immediate] Reconstructs an image from a Laplacian Image pyramid.
+ * \param [in] context The reference to the overall context.
+ * \param [in] laplacian The Laplacian pyramid with <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [in] input The lowest resolution image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format for the Laplacian pyramid.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format with the highest possible resolution reconstructed from the Laplacian pyramid. The output image format should be same as input image format.
+ * \ingroup group_vision_function_laplacian_reconstruct
+ * \see group_pyramid
+ * \return A <tt>\ref vx_status</tt> enumeration.
+ * \retval VX_SUCCESS Success.
+ * \retval * An error occured. See <tt>\ref vx_status_e</tt>
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuLaplacianReconstruct(vx_context context, vx_pyramid laplacian, vx_image input,
+                                       vx_image output);
+
+/*! \brief [Immediate] Computes an accumulation.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in,out] accum The accumulation image in <tt>\ref VX_DF_IMAGE_S16</tt>
+ * \ingroup group_vision_function_accumulate
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuAccumulateImage(vx_context context, vx_image input, vx_image accum);
+
+/*! \brief [Immediate] Computes a weighted accumulation.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] alpha A <tt>\ref VX_TYPE_FLOAT32</tt> type, the input value with the range \f$ 0.0 \le \alpha \le 1.0 \f$.
+ * \param [in,out] accum The <tt>\ref VX_DF_IMAGE_U8</tt> accumulation image.
+ * \ingroup group_vision_function_accumulate_weighted
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuAccumulateWeightedImage(vx_context context, vx_image input, vx_scalar alpha, vx_image accum);
+
+/*! \brief [Immediate] Computes a squared accumulation.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] shift A <tt>\ref VX_TYPE_UINT32</tt> type, the input value with the range \f$ 0 \le shift \le 15 \f$.
+ * \param [in,out] accum The accumulation image in <tt>\ref VX_DF_IMAGE_S16</tt>
+ * \ingroup group_vision_function_accumulate_square
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuAccumulateSquareImage(vx_context context, vx_image input, vx_scalar shift, vx_image accum);
+
+/*! \brief [Immediate] Computes the minimum and maximum values of the image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \param [out] minVal The minimum value in the image, which corresponds to the type of the input.
+ * \param [out] maxVal The maximum value in the image, which corresponds to the type of the input.
+ * \param [out] minLoc [optional] The minimum <tt>\ref VX_TYPE_COORDINATES2D</tt> locations. If the input image has several minimums, the kernel will return up to the capacity of the array.
+ * \param [out] maxLoc [optional] The maximum <tt>\ref VX_TYPE_COORDINATES2D</tt> locations. If the input image has several maximums, the kernel will return up to the capacity of the array.
+ * \param [out] minCount [optional] The total number of detected minimums in image. Use a <tt>\ref VX_TYPE_SIZE</tt> scalar.
+ * \param [out] maxCount [optional] The total number of detected maximums in image. Use a <tt>\ref VX_TYPE_SIZE</tt> scalar.
+ * \ingroup group_vision_function_minmaxloc
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuMinMaxLoc(vx_context context, vx_image input,
+                        vx_scalar minVal, vx_scalar maxVal,
+                        vx_array minLoc, vx_array maxLoc,
+                        vx_scalar minCount, vx_scalar maxCount);
+
+/*! \brief [Immediate] Computes pixel-wise minimum values between two images.
+ * \param [in] context The reference to the overall context.
+ * \param [in] in1 The first input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] in2 The second input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [out] out The output image which will hold the result of min.
+ * \ingroup group_vision_function_min
+ * \return  A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuMin(vx_context context, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Immediate] Computes pixel-wise maximum values between two images.
+ * \param [in]  context The reference to the overall context.
+ * \param [in] in1 The first input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [in] in2 The second input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
+ * \param [out] out The output image which will hold the result of max.
+ * \ingroup group_vision_function_max
+ * \return  A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuMax(vx_context context, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Immediate] Converts the input images bit-depth into the output image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image.
+ * \param [out] output The output image.
+ * \param [in] policy A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] shift A scalar containing a <tt>\ref VX_TYPE_INT32</tt> of the shift value.
+ * \ingroup group_vision_function_convertdepth
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>..
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuConvertDepth(vx_context context, vx_image input, vx_image output, vx_enum policy, vx_int32 shift);
+
+/*! \brief [Immediate] Computes Canny Edges on the input image into the output image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] hyst The double threshold for hysteresis. The <tt>\ref VX_THRESHOLD_INPUT_FORMAT</tt> shall be either
+ * <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>. The <tt>\ref VX_THRESHOLD_OUTPUT_FORMAT</tt> is ignored.
+ * \param [in] gradient_size The size of the Sobel filter window, must support at least 3, 5 and 7.
+ * \param [in] norm_type A flag indicating the norm used to compute the gradient, <tt>\ref VX_NORM_L1</tt> or <tt>\ref VX_NORM_L2</tt>.
+ * \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format with values either 0 or 255.
+ * \ingroup group_vision_function_canny
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuCannyEdgeDetector(vx_context context, vx_image input, vx_threshold hyst,
+                               vx_int32 gradient_size, vx_enum norm_type,
+                               vx_image output);
+
+/*! \brief [Immediate] Performs a Gaussian Blur on an image then half-scales it. The interpolation mode used is nearest-neighbor.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] kernel_size The input size of the Gaussian filter. Supported values are 1, 3 and 5.
+ * \ingroup group_vision_function_scale_image
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuHalfScaleGaussian(vx_context context, vx_image input, vx_image output, vx_int32 kernel_size);
+
+/*! \brief [Immediate] Computes the bitwise and between two images.
+ * \param [in] context The reference to the overall context.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
+ * \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image.
+ * \ingroup group_vision_function_and
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuAnd(vx_context context, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Immediate] Computes the bitwise inclusive-or between two images.
+ * \param [in] context The reference to the overall context.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
+ * \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image.
+ * \ingroup group_vision_function_or
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuOr(vx_context context, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Immediate] Computes the bitwise exclusive-or between two images.
+ * \param [in] context The reference to the overall context.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
+ * \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image.
+ * \ingroup group_vision_function_xor
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuXor(vx_context context, vx_image in1, vx_image in2, vx_image out);
+
+/*! \brief [Immediate] Computes the bitwise not of an image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The <tt>\ref VX_DF_IMAGE_U8</tt> input image
+ * \param [out] output The <tt>\ref VX_DF_IMAGE_U8</tt> output image.
+ * \ingroup group_vision_function_not
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuNot(vx_context context, vx_image input, vx_image output);
+
+/*! \brief [Immediate] Performs elementwise multiplications on pixel values in the input images and a scale.
+ * \param [in] context The reference to the overall context.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image.
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image.
+ * \param [in] scale A non-negative <tt>\ref VX_TYPE_FLOAT32</tt> multiplied to each product before overflow handling.
+ * \param [in] overflow_policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] rounding_policy A <tt>\ref vx_round_policy_e</tt> enumeration.
+ * \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \ingroup group_vision_function_mult
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuMultiply(vx_context context, vx_image in1, vx_image in2, vx_float32 scale, vx_enum overflow_policy, vx_enum rounding_policy, vx_image out);
+
+/*! \brief [Immediate] Performs arithmetic addition on pixel values in the input images.
+ * \param [in] context The reference to the overall context.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image.
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image.
+ * \param [in] policy A \ref vx_convert_policy_e enumeration.
+ * \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \ingroup group_vision_function_add
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuAdd(vx_context context, vx_image in1, vx_image in2, vx_enum policy, vx_image out);
+
+/*! \brief [Immediate] Performs arithmetic subtraction on pixel values in the input images.
+ * \param [in] context The reference to the overall context.
+ * \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image, the minuend.
+ * \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image, the subtrahend.
+ * \param [in] policy A \ref vx_convert_policy_e enumeration.
+ * \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
+ * \ingroup group_vision_function_sub
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuSubtract(vx_context context, vx_image in1, vx_image in2, vx_enum policy, vx_image out);
+
+/*! \brief [Immediate] Performs an Affine warp on an image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] matrix The affine matrix. Must be 2x3 of type \ref VX_TYPE_FLOAT32.
+ * \param [in] type The interpolation type from \ref vx_interpolation_type_e.
+ * \ref VX_INTERPOLATION_AREA is not supported.
+ * \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \ingroup group_vision_function_warp_affine
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuWarpAffine(vx_context context, vx_image input, vx_matrix matrix, vx_enum type, vx_image output);
+
+/*! \brief [Immediate] Performs an Perspective warp on an image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] matrix The perspective matrix. Must be 3x3 of type \ref VX_TYPE_FLOAT32.
+ * \param [in] type The interpolation type from \ref vx_interpolation_type_e.
+ * \ref VX_INTERPOLATION_AREA is not supported.
+ * \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \ingroup group_vision_function_warp_perspective
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuWarpPerspective(vx_context context, vx_image input, vx_matrix matrix, vx_enum type, vx_image output);
+
+/*! \brief [Immediate] Computes the Harris Corners over an image and produces the array of scored points.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] strength_thresh The <tt>\ref VX_TYPE_FLOAT32</tt> minimum threshold which to eliminate Harris Corner scores (computed using the normalized Sobel kernel).
+ * \param [in] min_distance The <tt>\ref VX_TYPE_FLOAT32</tt> radial Euclidean distance for non-maximum suppression.
+ * \param [in] sensitivity The <tt>\ref VX_TYPE_FLOAT32</tt> scalar sensitivity threshold \f$ k \f$ from the Harris-Stephens equation.
+ * \param [in] gradient_size The gradient window size to use on the input. The
+ * implementation must support at least 3, 5, and 7.
+ * \param [in] block_size The block window size used to compute the harris corner score.
+ * The implementation must support at least 3, 5, and 7.
+ * \param [out] corners The array of <tt>\ref VX_TYPE_KEYPOINT</tt> structs. The order of the keypoints in this array is implementation dependent.
+ * \param [out] num_corners [optional] The total number of detected corners in image. Use a \ref VX_TYPE_SIZE scalar
+ * \ingroup group_vision_function_harris
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuHarrisCorners(vx_context context,
+                           vx_image input,
+                           vx_scalar strength_thresh,
+                           vx_scalar min_distance,
+                           vx_scalar sensitivity,
+                           vx_int32 gradient_size,
+                           vx_int32 block_size,
+                           vx_array corners,
+                           vx_scalar num_corners);
+
+
+/*! \brief [Immediate] Computes corners on an image using FAST algorithm and produces the array of feature points.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] strength_thresh Threshold on difference between intensity of the central pixel and pixels on Bresenham's circle
+ * of radius 3 (<tt>\ref VX_TYPE_FLOAT32</tt> scalar), with a value in the range of 0.0 \f$\le\f$ strength_thresh < 256.0.
+ *  Any fractional value will be truncated to an integer.
+ * \param [in] nonmax_suppression If true, non-maximum suppression is applied to
+ * detected corners before being places in the <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt> structs.
+ * \param [out] corners Output corner <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt>. The order of the keypoints in this array is implementation dependent.
+ * \param [out] num_corners [optional] The total number of detected corners in image. Use a \ref VX_TYPE_SIZE scalar.
+ * \ingroup group_vision_function_fast
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval *          An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuFastCorners(vx_context context, vx_image input, vx_scalar strength_thresh, vx_bool nonmax_suppression, vx_array corners, vx_scalar num_corners);
+
+/*! \brief [Immediate] Computes an optical flow on two images.
+ * \param [in] context The reference to the overall context.
+ * \param [in] old_images Input of first (old) image pyramid in <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] new_images Input of destination (new) image pyramid in <tt>\ref VX_DF_IMAGE_U8</tt>
+ * \param [in] old_points an array of key points in a vx_array of <tt>\ref VX_TYPE_KEYPOINT</tt> those key points are defined at
+ *  the old_images high resolution pyramid
+ * \param [in] new_points_estimates an array of estimation on what is the output key points in a <tt>\ref vx_array</tt> of
+ * <tt>\ref VX_TYPE_KEYPOINT</tt> those keypoints are defined at the new_images high resolution pyramid
+ * \param [out] new_points an output array of key points in a <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt> those key points are
+ *  defined at the new_images high resolution pyramid
+ * \param [in] termination termination can be <tt>\ref VX_TERM_CRITERIA_ITERATIONS</tt> or <tt>\ref VX_TERM_CRITERIA_EPSILON</tt> or
+ * <tt>\ref VX_TERM_CRITERIA_BOTH</tt>
+ * \param [in] epsilon is the <tt>\ref vx_float32</tt> error for terminating the algorithm
+ * \param [in] num_iterations is the number of iterations. Use a <tt>\ref VX_TYPE_UINT32</tt> scalar.
+ * \param [in] use_initial_estimate Can be set to either <tt>\ref vx_false_e</tt> or <tt>\ref vx_true_e</tt>.
+ * \param [in] window_dimension The size of the window on which to perform the algorithm. See
+ *  <tt>\ref VX_CONTEXT_OPTICAL_FLOW_MAX_WINDOW_DIMENSION</tt>
+ *
+ * \ingroup group_vision_function_opticalflowpyrlk
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuOpticalFlowPyrLK(vx_context context,
+                              vx_pyramid old_images,
+                              vx_pyramid new_images,
+                              vx_array old_points,
+                              vx_array new_points_estimates,
+                              vx_array new_points,
+                              vx_enum termination,
+                              vx_scalar epsilon,
+                              vx_scalar num_iterations,
+                              vx_scalar use_initial_estimate,
+                              vx_size window_dimension);
+
+/*! \brief [Immediate]  The function compares an image template against overlapped image regions.
+ * \details The detailed equation to the matching can be found in <tt>\ref vx_comp_metric_e</tt>.
+ * The output of the template matching node is a comparison map as described in <tt>\ref vx_comp_metric_e</tt>.
+ * The Node have a limitation on the template image size (width*height). It should not be larger then 65535.
+ * If the valid region of the template image is smaller than the entire template image, the result in the destination image is implementation-dependent.
+ * \param [in] context The reference to the overall context.
+ * \param [in] src The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] templateImage Searched template of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] matchingMethod attribute specifying the comparison method <tt>\ref vx_comp_metric_e</tt>. This function support only <tt>\ref VX_COMPARE_CCORR_NORM</tt> and <tt>\ref VX_COMPARE_L2</tt>.
+ * \param [out] output Map of comparison results. The output is an image of type <tt>\ref VX_DF_IMAGE_S16</tt>
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ * \ingroup group_vision_function_match_template
+ */
+ VX_API_ENTRY vx_status VX_API_CALL vxuMatchTemplate(vx_context context, vx_image src, vx_image templateImage, vx_enum matchingMethod, vx_image output);
+
+ /*! \brief [Immediate] The function extracts LBP image from an input image
+ * \param [in] context The reference to the overall context.
+ * \param [in] in		An input image in <tt>vx_image</tt>. Or \f$ SrcImg\f$ in the equations. the image is of type <tt>\ref VX_DF_IMAGE_U8</tt>
+ * \param [in] format	A variation of LBP like original LBP and mLBP. see <tt> \ref vx_lbp_format_e </tt>
+ * \param [in] kernel_size Kernel size. Only size of 3 and 5 are supported
+ * \param [out] out	An output image in <tt>vx_image</tt>.Or \f$ DstImg\f$ in the equations. the image is of type <tt>\ref VX_DF_IMAGE_U8</tt>
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ * \ingroup group_vision_function_lbp
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuLBP(vx_context context,
+	vx_image in, vx_enum format, vx_int8 kernel_size, vx_image out);
+
+/*! \brief [Immediate] Performs cell calculations for the average gradient magnitude and gradient orientation histograms.
+ * \details Firstly, the gradient magnitude and gradient orientation are computed for each pixel in the input image.
+ * Two 1-D centred, point discrete derivative masks are applied to the input image in the horizontal and vertical directions.
+ * \f[ M_h = [-1, 0, 1] \f] and \f[ M_v = [-1, 0, 1]^T \f]
+ * \f$G_v\f$ is the result of applying mask \f$M_v\f$ to the input image, and \f$G_h\f$ is the result of applying mask \f$M_h\f$ to the input image.
+ * The border mode used for the gradient calculation is implementation dependent. Its behavior should be similar to <tt>\ref VX_BORDER_UNDEFINED</tt>.
+ * The gradient magnitudes and gradient orientations for each pixel are then calculated in the following manner.
+ * \f[ G(x,y) = \sqrt{G_v(x,y)^2 + G_h(x,y)^2} \f]
+ * \f[ \theta(x,y) = arctan(G_v(x,y), G_h(x,y)) \f]
+ * where \f$arctan(v, h)\f$
+ * is \f$ tan^{-1}(v/h)\f$ when \f$h!=0\f$,
+ *
+ * \f$ -pi/2 \f$ if \f$v<0\f$ and \f$h==0\f$,
+ *
+ * \f$  pi/2  \f$ if \f$v>0\f$ and \f$h==0\f$
+ *
+ * and \f$     0  \f$ if \f$v==0\f$ and \f$h==0\f$
+ *
+ * Secondly, the gradient magnitudes and orientations are used to compute the bins output tensor and optional magnitudes output tensor.
+ * These tensors are computed on a cell level where the cells are rectangular in shape.
+ * The magnitudes tensor contains the average gradient magnitude for each cell.
+ * \f[magnitudes(c) = \frac{1}{(cell\_width * cell\_height)}\sum\limits_{w=0}^{cell\_width} \sum\limits_{h=0}^{cell\_height} G_c(w,h)\f]
+ * where \f$G_c\f$ is the gradient magnitudes related to cell \f$c\f$.
+ * The bins tensor contains histograms of gradient orientations for each cell.
+ * The gradient orientations at each pixel range from 0 to 360 degrees.  These are quantised into a set of histogram bins based on the num_bins parameter.
+ * Each pixel votes for a specific cell histogram bin based on its gradient orientation.  The vote itself is the pixel's gradient magnitude.
+ * \f[bins(c, n) = \sum\limits_{w=0}^{cell\_width} \sum\limits_{h=0}^{cell\_height} G_c(w,h) * 1[B_c(w, h, num\_bins) == n]\f]
+ * where \f$B_c\f$ produces the histogram bin number based on the gradient orientation of the pixel at location (\f$w\f$, \f$h\f$) in cell \f$c\f$ based on
+ * the \f$num\_bins\f$ and \f[1[B_c(w, h, num\_bins) == n]\f] is a delta-function with value 1 when \f$B_c(w, h, num\_bins) == n\f$ or 0 otherwise.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] cell_width The histogram cell width of type <tt>\ref VX_TYPE_INT32</tt>.
+ * \param [in] cell_height The histogram cell height of type <tt>\ref VX_TYPE_INT32</tt>.
+ * \param [in] num_bins  The histogram size of type <tt>\ref VX_TYPE_INT32</tt>.
+ * \param [out] magnitudes The output average gradient magnitudes per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt> of size \f$ [floor(image_{width}/cell_{width}) ,floor(image_{height}/cell_{height}) ] \f$.
+ * \param [out] bins       The output gradient orientation histograms per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt> of size \f$ [floor(image_{width}/cell_{width}) ,floor(image_{height}/cell_{height}), num_{bins}] \f$.
+ *
+ * \ingroup group_vision_function_hog
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuHOGCells(vx_context context, vx_image input, vx_int32 cell_width, vx_int32 cell_height, vx_int32 num_bins, vx_tensor magnitudes, vx_tensor bins);
+
+/*! \brief [Immediate]  Computes Histogram of Oriented Gradients features for the W1xW2 window in a sliding window fashion over the whole input image.
+ * \details Firstly if a magnitudes tensor is provided the cell histograms in the bins tensor are normalised by the average cell gradient magnitudes.
+ \f[bins(c,n) = \frac{bins(c,n)}{magnitudes(c)}\f]
+ * To account for changes in illumination and contrast the cell histograms must be locally normalized which requires grouping the cell histograms together into larger spatially connected blocks.
+ * Blocks are rectangular grids represented by three parameters: the number of cells per block, the number of pixels per cell, and the number of bins per cell histogram.
+ * These blocks typically overlap, meaning that each cell histogram contributes more than once to the final descriptor.
+ * To normalize a block its cell histograms \f$h\f$ are grouped together to form a vector \f$v = [h_1, h_2, h_3, ... , h_n]\f$.
+ * This vector is normalised using L2-Hys which means performing L2-norm on this vector; clipping the result (by limiting the maximum values of v to be threshold) and renormalizing again. If the threshold is equal to zero then L2-Hys normalization is not performed.
+ * \f[L2norm(v) = \frac{v}{\sqrt{\|v\|_2^2 + \epsilon^2}}\f]
+ * where \f$ \|v\|_k \f$ be its k-norm for k=1, 2, and \f$ \epsilon \f$ be a small constant.
+ * For a specific window its HOG descriptor is then the concatenated vector of the components of the normalized cell histograms from all of the block regions contained in the window.
+ * The W1xW2 window starting position is at coordinates 0x0.
+ * If the input image has dimensions that are not an integer multiple of W1xW2 blocks with the specified stride, then the last positions that contain only a partial W1xW2 window
+ * will be calculated with the remaining part of the W1xW2 window padded with zeroes.
+ * The Window W1xW2 must also have a size so that it contains an integer number of cells, otherwise the node is not well-defined.
+ * The final output tensor will contain HOG descriptors equal to the number of windows in the input image.
+ * The output features tensor has 3 dimensions, given by:\n
+ * \f[[ (floor((image_{width}-window_{width})/window_{stride}) + 1),\f]
+ * \f[ (floor((image_{height}-window_{height})/window_{stride}) + 1),\f]
+ * \f[ floor((window_{width} - block_{width})/block_{stride} + 1) * floor((window_{height} - block_{height})/block_{stride} + 1) *\f]
+*  \f[ (((block_{width} * block_{height}) / (cell_{width} * cell_{height})) * num_{bins})] \f]
+ * See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
+ * The output tensor from this function may be very large.  For this reason, is it not recommended that this "immediate mode" version of the function be used.
+ * The preferred method to perform this function is as graph node with a virtual tensor as the output.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
+ * \param [in] magnitudes The averge gradient magnitudes per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>. It is the output of <tt>\ref vxuHOGCells</tt>.
+ * \param [in] bins       The gradient orientation histogram per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>. It is the output of <tt>\ref vxuHOGCells</tt>.
+ * \param [in] params The parameters of type <tt>\ref vx_hog_t</tt>.
+ * \param [in] hog_param_size Size of <tt>\ref vx_hog_t</tt> in bytes.
+ * \param [out] features The output HOG features of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>.
+ *
+ * \ingroup group_vision_function_hog
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+
+VX_API_ENTRY vx_status VX_API_CALL vxuHOGFeatures(vx_context context, vx_image input, vx_tensor magnitudes, vx_tensor bins, const vx_hog_t *params, vx_size hog_param_size, vx_tensor features);
+
+/*! \brief [Immediate] Finds the Probabilistic Hough Lines detected in the input binary image, each line is stored in the output array as a set of points (x1, y1, x2, y2) .
+ * \details Some implementations of the algorithm may have a random or non-deterministic element. If the target application is in a safety-critical environment this 
+ * should be borne in mind and steps taken in the implementation, the application or both to achieve the level of determinism required by the system design.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input 8 bit, single channel binary source image
+ * \param [in] params parameters of the struct <tt>\ref vx_hough_lines_p_t</tt>
+ * \param [out] lines_array lines_array contains array of lines, see <tt>\ref vx_line2d_t</tt> The order of lines in implementation dependent
+ * \param [out] num_lines [optional] The total number of detected lines in image. Use a VX_TYPE_SIZE scalar
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ * \ingroup group_vision_function_hough_lines_p
+  */
+VX_API_ENTRY vx_status VX_API_CALL vxuHoughLinesP(vx_context context, vx_image input, const vx_hough_lines_p_t *params, vx_array lines_array, vx_scalar num_lines);
+
+/*! \brief [Immediate] Remaps an output image from an input image.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \param [in] table The remap table object.
+ * \param [in] policy The interpolation policy from \ref vx_interpolation_type_e.
+ * \ref VX_INTERPOLATION_AREA is not supported.
+ * \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \ingroup group_vision_function_remap
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuRemap(vx_context context,
+                  vx_image input,
+                  vx_remap table,
+                  vx_enum policy,
+                  vx_image output);
+
+/*! \brief [Immediate] The function applies bilateral filtering to the input tensor.
+* \param [in] context The reference to the overall context.
+* \param [in] src The input data a <tt>\ref vx_tensor</tt>. maximum 3 dimension and minimum 2. The tensor is of type <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT16</tt>.
+* dimensions are [radiometric ,width,height] or [width,height]
+* \param [in] diameter of each pixel neighbourhood that is used during filtering. Values of diameter must be odd. Bigger then 3 and smaller then 10.
+* \param [in] sigmaValues Filter sigma in the radiometric space. Supported values are bigger then 0 and smaller or equal 20.
+* \param [in] sigmaSpace Filter sigma in the spatial space. Supported values are bigger then 0 and smaller or equal 20.
+* \param [out] dst The output data a <tt>\ref vx_tensor</tt>,Of type <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT16</tt>. And must be the same type and size of the input.
+* \note The border modes
+*  <tt>\ref VX_NODE_BORDER</tt> value
+*  <tt>\ref VX_BORDER_REPLICATE</tt> and <tt>\ref VX_BORDER_CONSTANT</tt> are supported.
+* \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+* \ingroup group_vision_function_bilateral_filter
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxuBilateralFilter(vx_context context, vx_tensor src, vx_int32 diameter, vx_float32 sigmaSpace, vx_float32 sigmaValues, vx_tensor dst);
+
+/*! \brief [Immediate] Performs element wise multiplications on element values in the input tensor data with a scale.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
+ * The data type must match the data type of Input1.
+ * \param [in] scale A non-negative <tt>\ref VX_TYPE_FLOAT32</tt> multiplied to each product before overflow handling.
+ * \param [in] overflow_policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] rounding_policy A <tt>\ref vx_round_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_multiply
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuTensorMultiply(vx_context context, vx_tensor input1, vx_tensor input2, vx_scalar scale, vx_enum overflow_policy,
+        vx_enum rounding_policy, vx_tensor output);
+
+/*! \brief [Immediate] Performs arithmetic addition on element values in the input tensor data.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
+ * The data type must match the data type of Input1.
+ * \param [in] policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_add
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuTensorAdd(vx_context context, vx_tensor input1, vx_tensor input2, vx_enum policy, vx_tensor output);
+
+/*! \brief [Immediate] Performs arithmetic subtraction on element values in the input tensor data.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input1 Input tensor data.  Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
+ * In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
+ * and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
+ * The data type must match the data type of Input1.
+ * \param [in] policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_subtract
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuTensorSubtract(vx_context context, vx_tensor input1, vx_tensor input2, vx_enum policy, vx_tensor output);
+
+/*! \brief [Immediate] Performs LUT on element values in the input tensor data.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input1 Input tensor data. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt>, with fixed_point_position 0.
+ * \param [in] lut The look-up table to use, of type <tt>\ref vx_lut</tt>.
+ * The elements of input1 are treated as unsigned integers to determine an index into the look-up table.
+ * The data type of the items in the look-up table must match that of the output tensor.
+ * \param [out] output The output tensor data with the same dimensions as the input tensor data.
+ * \ingroup group_vision_function_tensor_tablelookup
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuTensorTableLookup(vx_context context, vx_tensor input1, vx_lut lut, vx_tensor output);
+
+/*! \brief [Immediate] Performs transpose on the input tensor.
+ * The tensor is transposed according to a specified 2 indexes in the tensor (0-based indexing)
+ * \param [in] context The reference to the overall context.
+ * \param [in] input Input tensor data, Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [out] output output tensor data,
+ * \param [in] dimension1 Dimension index that is transposed with dim 2.
+ * \param [in] dimension2 Dimension index that is transposed with dim 1.
+ * \ingroup group_vision_function_tensor_transpose
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuTensorTranspose(vx_context context, vx_tensor input, vx_tensor output, vx_size dimension1, vx_size dimension2);
+
+/*! \brief [Immediate] Performs a bit-depth conversion.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input tensor. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
+ * and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
+ * \param [in] policy A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_convert_policy_e</tt> enumeration.
+ * \param [in] norm A scalar containing a <tt>\ref VX_TYPE_FLOAT32</tt> of the normalization value.
+ * \param [in] offset A scalar containing a <tt>\ref VX_TYPE_FLOAT32</tt> of the offset value subtracted before normalization.
+ * \param [out] output The output tensor. Implementations must support input tensor data type <tt>VX_TYPE_INT16</tt>. with fixed_point_position 8.
+ * And <tt>VX_TYPE_UINT8</tt> with fixed_point_position 0.
+ * \ingroup group_vision_function_tensor_convert_depth
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuTensorConvertDepth(vx_context context, vx_tensor input, vx_enum policy, vx_scalar norm, vx_scalar offset, vx_tensor output);
+
+/*! \brief [Immediate] Performs a generalized matrix multiplication.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input1 The first input 2D tensor of type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_pos 8, or tensor data types <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_pos 0.
+ * \param [in] input2 The second 2D tensor. Must be in the same data type as input1.
+ * \param [in] input3 The third 2D tensor. Must be in the same data type as input1. [optional].
+ * \param [in] matrix_multiply_params Matrix multiply parameters, see <tt>\ref vx_tensor_matrix_multiply_params_t </tt>.
+ * \param [out] output The output 2D tensor. Must be in the same data type as input1. Output dimension must agree the formula in the description.
+ * \ingroup group_vision_function_tensor_matrix_multiply
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuTensorMatrixMultiply(vx_context context, vx_tensor input1, vx_tensor input2, vx_tensor input3,
+    const vx_tensor_matrix_multiply_params_t *matrix_multiply_params, vx_tensor output);
+
+
+/*! \brief [Immediate] Copy data from one object to another.
+ * \param [in] context The reference to the overall context.
+ * \param [in] input The input data object.
+ * \param [out] output The output data object.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_SUCCESS Success
+ * \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
+ * \ingroup group_vision_function_copy
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxuCopy(vx_context context, vx_reference input, vx_reference output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 166 - 0
include_bakbak/VX_EXT/vx_amd_nn.h

@@ -0,0 +1,166 @@
+/*
+Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+
+#ifndef _VX_AMD_NN_H_
+#define _VX_AMD_NN_H_
+
+#include <VX/vx.h>
+#include <VX/vx_khr_nn.h>
+#include <vx_ext_amd.h>
+
+/*! \brief [Graph] Creates a Batch Normalization Layer Node.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [in] inputs The mean tensor data.
+ * \param [in] inputs The variance tensor data.
+ * \param [in] inputs The scale tensor data.
+ * \param [in] inputs The bias tensor data.
+ * \param [in] inputs The eps vx_float32 data.
+ * \param [out] outputs The output tensor data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxBatchNormalizationLayer(vx_graph graph, vx_tensor inputs, vx_tensor mean, vx_tensor variance, vx_tensor scale, vx_tensor bias, vx_float32 eps, vx_tensor output);
+
+/*! \brief [Graph] Creates a Scale Layer Node.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [in] inputs The scale tensor data.
+ * \param [in] inputs The bias tensor data.
+ * \param [out] outputs The output tensor data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxScaleLayer(vx_graph graph, vx_tensor inputs, vx_tensor scale, vx_tensor bias, vx_tensor output);
+
+/*! \brief [Graph] Creates a Argmax Layer Node.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] outputs The output tensor data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxArgmaxLayer(vx_graph graph, vx_tensor input, vx_reference output);
+
+/*! \brief [Graph] Creates a Image to Tensor Node.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] outputs The output tensor data.
+ * \param [in] inputs The a vx_float32 data.
+ * \param [in] inputs The b vx_float32 data.
+ * \param [in] inputs The reverse channel order vx_bool data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxConvertImageToTensorNode(vx_graph graph, vx_image input, vx_tensor output, vx_float32 a, vx_float32 b, vx_bool reverse_channel_order);
+
+/*! \brief [Graph] Creates a Tensor to Image Node.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] outputs The output tensor data.
+ * \param [in] inputs The a vx_float32 data.
+ * \param [in] inputs The b vx_float32 data.
+ * \param [in] inputs The reverse channel order vx_bool data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxConvertTensorToImageNode(vx_graph graph, vx_tensor input, vx_image output, vx_float32 a, vx_float32 b, vx_bool reverse_channel_order);
+
+/*! \brief [Graph] Creates a Concat Layer Node.
+ * \param [in] graph The handle to the graph.
+ * \param [out] outputs The output tensor data.
+ * \param [in] inputs The input 1 tensor data.
+ * \param [in] inputs The input 2 tensor data.
+ * \param [in] inputs The input 3 tensor data.
+ * \param [in] inputs The input 4 tensor data.
+ * \param [in] inputs The input 5 tensor data.
+ * \param [in] inputs The input 6 tensor data.
+ * \param [in] inputs The input 7 tensor data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+//VX_API_ENTRY vx_node VX_API_CALL vxConcatLayer(vx_graph graph, vx_tensor output, vx_tensor input1, vx_tensor input2, vx_tensor input3, vx_tensor input4, vx_tensor input5, vx_tensor input6, vx_tensor input7, vx_tensor input8);
+VX_API_ENTRY vx_node VX_API_CALL vxConcatLayer(vx_graph graph, vx_size axis, vx_tensor_array_t * output_tensors, vx_size size_of_output_tensors, vx_tensor output);
+
+/*! \brief [Graph] Creates a Slice Layer Node.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] inputs The output 1 tensor data.
+ * \param [out] inputs The output 2 tensor data.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+//VX_API_ENTRY vx_node VX_API_CALL vxSliceLayer(vx_graph graph, vx_tensor input, vx_tensor output1, vx_tensor output2, vx_tensor output3, vx_tensor output4, vx_tensor output5, vx_tensor output6, vx_tensor output7, vx_tensor output8);
+VX_API_ENTRY vx_node VX_API_CALL vxSliceLayer(vx_graph graph, vx_tensor input, vx_size axis, vx_tensor_array_t * output_tensors, vx_size size_of_output_tensors);
+
+/*! \brief [Graph] Creates a Convolutional Network Upsampling Layer Node.
+ * \details Upsampling is done on the width and height dimensions of the <tt>\ref vx_tensor</tt>. Therefore, we use here the term x for the width dimension and y for the height dimension.\n
+ * The Upsampling accept input images as tensors of several types. They always output resized images as float32 tensors.
+ * This function supports 4D and 3D tensors as input and output. 4D tensors are for batches of images, 3D tensors for individual images.
+ * Upsampling use resize method NEAREST_NEIGHBOR.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input. Output tensor data type must be same as the inputs. The width and height dimensions of output must be integer multiple of input. The batch and channel dimensions of output and input must be same.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxUpsampleLayer(vx_graph graph, vx_tensor input, vx_tensor output);
+
+/*! \brief [Graph] Creates a Convolutional Network Reshape Layer Node.
+ * \details Reshaping is done with alias if available (output tensor will point to input tensor memory). Otherwise it will do a copy.\n
+ * This function supports 4D tensors as input and output.
+ * \param [in] graph The handle to the graph.
+ * \param [in] inputs The input tensor data.
+ * \param [out] outputs The output tensor data. Output will have the same number of dimensions as input. Output tensor data type must be same as the inputs. The width and height dimensions of output must be integer multiple of input. The batch and channel dimensions of output and input must be same.
+ * \return <tt> vx_node</tt>.
+ * \returns A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a
+ * successful creation should be checked using <tt>\ref vxGetStatus</tt>.
+ */
+VX_API_ENTRY vx_node VX_API_CALL vxReshapeLayer(vx_graph graph, vx_tensor input, vx_tensor output);
+VX_API_ENTRY vx_node VX_API_CALL vxExecuteLayerDummy(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxEndLayerDummy(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxSyncLayerDummy(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxPixelShuffleLayer(vx_graph graph, vx_tensor inputs, vx_int32 scale, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxPermuteLayer(vx_graph graph, vx_tensor inputs, const vx_nn_permute_params_t* permute_params, vx_size size_of_permute_params, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxDummyDataLayer(vx_graph graph, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxCropLayer(vx_graph graph, vx_tensor inputs1, vx_tensor inputs2, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxResizeLayer(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
+VX_API_ENTRY vx_node VX_API_CALL vxSplitLayer(vx_graph graph, vx_tensor input, vx_tensor_array_t * output_tensors, vx_size size_of_output_tensors);
+VX_API_ENTRY vx_node VX_API_CALL vxCustomLayer(vx_graph graph,
+											vx_tensor inputs,
+											vx_tensor weights,
+											vx_tensor biases,
+											const vx_char * type,
+											vx_nn_custom_params_t * custom_params,
+											vx_size size_of_custom_params,
+											vx_tensor outputs);
+
+#endif

+ 627 - 0
include_bakbak/VX_EXT/vx_ext_amd.h

@@ -0,0 +1,627 @@
+/*
+Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+
+#ifndef _VX_EXT_AMD_H_
+#define _VX_EXT_AMD_H_
+
+#include <VX/vx.h>
+#include <VX/vx_khr_nn.h>
+#ifdef __cplusplus
+#include <string>
+#include <vector>
+#include <map>
+#endif
+
+/*! \brief AMD target affinity enumerations for AgoTargetAffinityInfo.device_type
+*/
+#define AGO_TARGET_AFFINITY_CPU       0x0010 // CPU
+#define AGO_TARGET_AFFINITY_GPU       0x0020 // GPU
+
+/*! \brief AMD internal parameters. [TODO: This needs to be moved to ago_internal.h]
+*/
+#define AGO_MAX_PARAMS                                   32
+#define AGO_MERGE_RULE_MAX_FIND                           4
+#define AGO_MERGE_RULE_MAX_REPLACE                        4
+#define AGO_MERGE_RULE_SOLITARY_FLAG                   0x20
+#define AGO_TARGET_AFFINITY_GPU_INFO_DEVICE_MASK       0x0F
+#define AGO_TARGET_AFFINITY_GPU_INFO_SVM_MASK          0xF0
+#define AGO_TARGET_AFFINITY_GPU_INFO_SVM_ENABLE        0x10
+#define AGO_TARGET_AFFINITY_GPU_INFO_SVM_AS_CLMEM      0x20
+#define AGO_TARGET_AFFINITY_GPU_INFO_SVM_NO_FGS        0x40
+
+/*! \brief Maximum size of scalar string buffer. The local buffers used for accessing scalar strings
+* should be of size VX_MAX_STRING_BUFFER_SIZE_AMD and the maximum allowed string length is
+* VX_MAX_STRING_BUFFER_SIZE_AMD-1.
+* \ingroup group_scalar
+*/
+#define VX_MAX_STRING_BUFFER_SIZE_AMD                   256
+
+/*! \brief The Neural Network activation functions vx_nn_activation_function_e extension.
+ */
+#define VX_NN_ACTIVATION_LEAKY_RELU  (VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x9)
+
+/*! \brief The type enumeration lists all the AMD specific types in OpenVX.
+*/
+enum ago_type_public_e {
+	/*! \brief AMD data types
+	*/
+	VX_TYPE_FLOAT16             = 0x00F,                     // 16-bit float data type
+	VX_TYPE_STRING_AMD          = 0x011,                     // scalar data type for string
+
+	/*! \brief AMD data structs
+	*/
+	AGO_TYPE_KEYPOINT_XYS = VX_TYPE_VENDOR_STRUCT_START,     // AGO struct data type for keypoint XYS
+
+	/*! \brief AMD data object types
+	*/
+	AGO_TYPE_MEANSTDDEV_DATA = VX_TYPE_VENDOR_OBJECT_START,  // AGO data structure for AGO MeanStdDev kernels
+	AGO_TYPE_MINMAXLOC_DATA,                                 // AGO data structure for AGO MinMaxLoc kernels
+	AGO_TYPE_CANNY_STACK,                                    // AGO data structure for AGO Canny kernels
+	AGO_TYPE_SCALE_MATRIX,                                   // AGO data structure for AGO Scale kernels
+};
+
+/*! \brief The AMD context attributes list.
+*/
+enum vx_context_attribute_amd_e {
+	/*! \brief OpenCL context. Use a <tt>\ref cl_context</tt> parameter.*/
+	VX_CONTEXT_ATTRIBUTE_AMD_OPENCL_CONTEXT = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x01,
+	/*! \brief context affinity. Use a <tt>\ref AgoTargetAffinityInfo</tt> parameter.*/
+	VX_CONTEXT_ATTRIBUTE_AMD_AFFINITY       = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x02,
+	/*! \brief set a text macro definition. Use a <tt>\ref AgoContextMacroInfo</tt> parameter.*/
+	VX_CONTEXT_ATTRIBUTE_AMD_SET_TEXT_MACRO = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x03,
+	/*! \brief set a merge rule. Use a <tt>\ref AgoNodeMergeRule</tt> parameter.*/
+	VX_CONTEXT_ATTRIBUTE_AMD_SET_MERGE_RULE = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x04,
+	/*! \brief tensor Data max num of dimensions supported by HW. */
+	VX_CONTEXT_MAX_TENSOR_DIMENSIONS = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x05,
+	/*! \brief CL_QUEUE_PROPERTIES to be used for creating OpenCL command queue. Use a <tt>\ref cl_command_queue_properties</tt> parameter. */
+	VX_CONTEXT_CL_QUEUE_PROPERTIES = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x06,
+};
+
+/*! \brief The AMD kernel attributes list.
+*/
+enum vx_kernel_attribute_amd_e {
+	/*! \brief kernel callback for query target support. Use a <tt>\ref amd_kernel_query_target_support_f</tt> parameter.*/
+	VX_KERNEL_ATTRIBUTE_AMD_QUERY_TARGET_SUPPORT    = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_KERNEL) + 0x01,
+	/*! \brief kernel callback for OpenCL code generation. Use a <tt>\ref amd_kernel_opencl_codegen_callback_f</tt> parameter.*/
+	VX_KERNEL_ATTRIBUTE_AMD_OPENCL_CODEGEN_CALLBACK = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_KERNEL) + 0x02,
+	/*! \brief kernel callback for node regeneration. Use a <tt>\ref amd_kernel_node_regen_callback_f</tt> parameter.*/
+	VX_KERNEL_ATTRIBUTE_AMD_NODE_REGEN_CALLBACK     = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_KERNEL) + 0x03,
+	/*! \brief kernel callback for OpenCL global work[]. Use a <tt>\ref amd_kernel_opencl_global_work_update_callback_f</tt> parameter.*/
+	VX_KERNEL_ATTRIBUTE_AMD_OPENCL_GLOBAL_WORK_UPDATE_CALLBACK = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_KERNEL) + 0x04,
+	/*! \brief kernel flag to enable OpenCL buffer access (default OFF). Use a <tt>\ref vx_bool</tt> parameter.*/
+	VX_KERNEL_ATTRIBUTE_AMD_OPENCL_BUFFER_ACCESS_ENABLE        = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_KERNEL) + 0x05,
+	/*! \brief kernel callback for OpenCL buffer update. Use a <tt>\ref AgoKernelOpenclBufferUpdateInfo</tt> parameter.*/
+	VX_KERNEL_ATTRIBUTE_AMD_OPENCL_BUFFER_UPDATE_CALLBACK      = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_KERNEL) + 0x06,
+};
+
+/*! \brief The AMD graph attributes list.
+*/
+enum vx_graph_attribute_amd_e {
+	/*! \brief graph affinity. Use a <tt>\ref AgoNodeAffinityInfo</tt> parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_AFFINITY                     = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x01,
+	/*! \brief imports a graph from a text file. Use a <tt>\ref AgoGraphImportInfo</tt> parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_IMPORT_FROM_TEXT             = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x02,
+	/*! \brief export a graph into a text file. Use a <tt>\ref AgoGraphExportInfo</tt> parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_EXPORT_TO_TEXT               = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x03,
+	/*! \brief graph optimizer flags. Use a <tt>\ref vx_uint32</tt> parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_OPTIMIZER_FLAGS              = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x04,
+	/*! \brief graph last performance (internal). Use a <tt>\ref AgoGraphPerfInternalInfo</tt> parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_PERFORMANCE_INTERNAL_LAST    = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x05,
+	/*! \brief graph avg performance (internal). Use a <tt>\ref AgoGraphPerfInternalInfo</tt> parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_PERFORMANCE_INTERNAL_AVG     = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x06,
+	/*! \brief graph internal performance profile. Use a char * fileName parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_PERFORMANCE_INTERNAL_PROFILE = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x07,
+	/*! \brief OpenCL command queue. Use a <tt>\ref cl_command_queue</tt> parameter.*/
+	VX_GRAPH_ATTRIBUTE_AMD_OPENCL_COMMAND_QUEUE         = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_GRAPH) + 0x08,
+};
+
+/*! \brief The AMD node attributes list.
+*/
+enum vx_node_attribute_amd_e {
+	/*! \brief node affinity. Use a <tt>\ref AgoTargetAffinityInfo</tt> parameter.*/
+	VX_NODE_ATTRIBUTE_AMD_AFFINITY                      = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_NODE) + 0x01,
+	/*! \brief OpenCL command queue. Use a <tt>\ref cl_command_queue</tt> parameter.*/
+	VX_NODE_ATTRIBUTE_AMD_OPENCL_COMMAND_QUEUE          = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_NODE) + 0x02,
+};
+
+/*! \brief The AMD image attributes list.
+*/
+enum vx_image_attribute_amd_e {
+	/*! \brief sync with user specified OpenCL buffer. Use a <tt>\ref cl_mem</tt> parameter.*/
+	VX_IMAGE_ATTRIBUTE_AMD_OPENCL_BUFFER             = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_IMAGE) + 0x01,
+	/*! \brief OpenCL buffer offset. Use a <tt>\ref cl_uint</tt> parameter.*/
+	VX_IMAGE_ATTRIBUTE_AMD_OPENCL_BUFFER_OFFSET      = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_IMAGE) + 0x02,
+	/*! \brief Enable user kernel's own OpenCL buffer for virtual images. Supports only images with
+	* single color plane and stride should match framework's internal alignment. image ROI not supported.
+	* Use a <tt>\ref vx_bool</tt> parameter.*/
+	VX_IMAGE_ATTRIBUTE_AMD_ENABLE_USER_BUFFER_OPENCL = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_IMAGE) + 0x03,
+	/*! \brief OpenCL buffer stride. Use a <tt>\ref cl_uint</tt> parameter.*/
+	VX_IMAGE_ATTRIBUTE_AMD_OPENCL_BUFFER_STRIDE      = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_IMAGE) + 0x04,
+};
+
+/*! \brief tensor Data attributes.
+* \ingroup group_tensor
+*/
+enum vx_tensor_attribute_amd_e {
+	/*! \brief OpenCL buffer strides (array of <tt>vx_size</tt>). */
+	VX_TENSOR_STRIDE_OPENCL   = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0x5,
+	/*! \brief OpenCL buffer offset. <tt>vx_size</tt>. */
+	VX_TENSOR_OFFSET_OPENCL   = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0x6,
+	/*! \brief OpenCL buffer. <tt>cl_mem</tt>. */
+	VX_TENSOR_BUFFER_OPENCL   = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0x7,
+    /*! \brief Queries memory type if created using vxCreateTensorFromHandle. If vx_tensor was not created using
+        vxCreateTensorFromHandle, VX_MEMORY_TYPE_NONE is returned. Use a <tt>\ref vx_memory_type_e</tt> parameter. */
+	VX_TENSOR_MEMORY_TYPE     = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0x8,
+	VX_TENSOR_MEMORY_HANDLE   = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0x9,
+	VX_TENSOR_MEMORY_PHYS_ADDR= VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0xa,
+	VX_TENSOR_MEMORY_VIRT_ADDR= VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0xb,
+	VX_TENSOR_MEMORY_SIZE	  = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_TENSOR) + 0xc,
+};
+
+/*! \brief These enumerations are given to the \c vxDirective API to enable/disable
+* platform optimizations and/or features. Directives are not optional and
+* usually are vendor-specific, by defining a vendor range of directives and
+* starting their enumeration from there.
+* \see <tt>vxDirective</tt>
+* \ingroup group_directive
+*/
+enum vx_directive_amd_e {
+	/*! \brief data object is readonly after this directive is given. */
+	VX_DIRECTIVE_AMD_READ_ONLY      = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_DIRECTIVE) + 0x01,
+	/*! \brief data object copy to OpenCL. */
+	VX_DIRECTIVE_AMD_COPY_TO_OPENCL = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_DIRECTIVE) + 0x02,
+	/*! \brief collect performance profile capture. */
+	VX_DIRECTIVE_AMD_ENABLE_PROFILE_CAPTURE  = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_DIRECTIVE) + 0x03,
+	VX_DIRECTIVE_AMD_DISABLE_PROFILE_CAPTURE = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_DIRECTIVE) + 0x04,
+	/*! \brief disable node level flush for a graph. */
+	VX_DIRECTIVE_AMD_DISABLE_OPENCL_FLUSH    = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_DIRECTIVE) + 0x05,
+};
+
+/*! \brief An enumeration of additional memory type imports.
+* \ingroup group_context
+*/
+enum vx_memory_type_amd_e {
+	/*! \brief The memory type to import from the OpenCL. Use */
+	VX_MEMORY_TYPE_OPENCL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_MEMORY_TYPE) + 0x2,
+};
+
+/*! \brief The image color space list used by the <tt>\ref VX_IMAGE_SPACE</tt> attribute of a <tt>\ref vx_image</tt>.
+* \ingroup group_image
+*/
+enum vx_color_space_amd_e {
+	/*! \brief Use to indicate that the BT.2020 coefficients are used for conversions. */
+	VX_COLOR_SPACE_BT2020 = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_COLOR_SPACE) + 0x1,
+};
+
+/*! \brief Based on the VX_DF_IMAGE definition.
+* \note Use <tt>\ref vx_df_image</tt> to contain these values.
+*/
+enum vx_df_image_amd_e {
+	VX_DF_IMAGE_U1_AMD    = VX_DF_IMAGE('U', '0', '0', '1'),  // AGO image with 1-bit data
+	VX_DF_IMAGE_F16_AMD   = VX_DF_IMAGE('F', '0', '1', '6'),  // AGO image with 16-bit floating-point (half)
+	VX_DF_IMAGE_F32_AMD   = VX_DF_IMAGE('F', '0', '3', '2'),  // AGO image with 32-bit floating-point (float)
+	VX_DF_IMAGE_F64_AMD   = VX_DF_IMAGE('F', '0', '6', '4'),  // AGO image with 64-bit floating-point (double)
+	VX_DF_IMAGE_F32x3_AMD = VX_DF_IMAGE('F', '3', '3', '2'),  // AGO image with THREE 32-bit floating-point channels in one buffer
+};
+
+enum vx_action_amd_e {
+	VX_ACTION_CPU_EXEC = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_ACTION) + 0x0,
+	VX_ACTION_NU_EXEC  = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_ACTION) + 0x1,
+	VX_ACTION_VU_EXEC  = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_ACTION) + 0x2,
+};
+
+enum vx_action_vpu_e {
+	VX_ACTION_VPU_RSZ = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_ACTION) + 0x10,
+	VX_ACTION_VPU_MBG = VX_ENUM_BASE(VX_ID_AMD, VX_ENUM_ACTION) + 0x11,
+};
+
+/*! \brief The multidimensional data object (Tensor).
+* \see vxCreateTensor
+* \ingroup group_tensor
+* \extends vx_reference
+*/
+typedef struct _vx_tensor_t * vx_tensor;
+
+/*! \brief Image format information.
+*/
+typedef struct {
+	vx_size            components;
+	vx_size            planes;
+	vx_size            pixelSizeInBitsNum;
+	vx_color_space_e   colorSpace;
+	vx_channel_range_e channelRange;
+	vx_size            pixelSizeInBitsDenom;
+} AgoImageFormatDescription;
+
+/*! \brief AMD data structure to specify target affinity.
+*/
+typedef struct {
+	vx_uint32 device_type; // shall be AGO_TARGET_AFFINITY_CPU or AGO_TARGET_AFFINITY_GPU
+	vx_uint32 device_info; // reserved -- shall be initialized to ZERO and shall not be modified
+	vx_uint32 reserved[2]; // reserved -- shall be initialized to ZERO and shall not be modified
+} AgoTargetAffinityInfo;
+
+/*! \brief AMD data structure to set a text macro.
+*/
+typedef struct {
+	vx_char macroName[256];
+	vx_char * text;
+} AgoContextTextMacroInfo;
+
+/*! \brief AMD data structure to import a graph from a text.
+**    text:
+**      "macro <macro-name>" to use a pre-defined macro
+**      "file <file-name>" to load from a file
+**      otherwise use the text as is
+*/
+typedef struct {
+	vx_char * text;
+	vx_uint32 num_ref;
+	vx_reference * ref;
+	vx_int32 dumpToConsole;
+	void (VX_CALLBACK * data_registry_callback_f) (void * obj, vx_reference ref, const char * name, const char * app_params);
+	void * data_registry_callback_obj;
+} AgoGraphImportInfo;
+
+/*! \brief AMD data structure to export a graph to a text.
+*/
+typedef struct {
+	vx_char fileName[256];
+	vx_uint32 num_ref;
+	vx_reference * ref;
+	vx_char comment[64];
+} AgoGraphExportInfo;
+
+/*! \brief AMD data structure to get internal performance data.
+*/
+typedef struct {
+	vx_uint64 kernel_enqueue;
+	vx_uint64 kernel_wait;
+	vx_uint64 buffer_read;
+	vx_uint64 buffer_write;
+} AgoGraphPerfInternalInfo;
+
+/*! \brief AMD data structure to specify node merge rule.
+*/
+typedef struct AgoNodeMergeRule_t {
+	struct {
+		vx_enum    kernel_id;
+		vx_uint32  arg_spec[AGO_MAX_PARAMS];
+	} find[AGO_MERGE_RULE_MAX_FIND];
+	struct {
+		vx_enum    kernel_id;
+		vx_uint32  arg_spec[AGO_MAX_PARAMS];
+	} replace[AGO_MERGE_RULE_MAX_REPLACE];
+} AgoNodeMergeRule;
+
+
+#ifdef __cplusplus
+/*! \brief AMD usernode callback for target support check - supported_target_affinity shall contain bitfields AGO_TARGET_AFFINITY_CPU and AGO_TARGET_AFFINITY_GPU.
+*   When this callback is not available, the framework assumes that supported_target_affinity = AGO_TARGET_AFFINITY_CPU.
+*/
+typedef vx_status(VX_CALLBACK * amd_kernel_query_target_support_f) (vx_graph graph, vx_node node,
+	vx_bool use_opencl_1_2,              // [input]  false: OpenCL driver is 2.0+; true: OpenCL driver is 1.2
+	vx_uint32& supported_target_affinity // [output] must be set to AGO_TARGET_AFFINITY_CPU or AGO_TARGET_AFFINITY_GPU or (AGO_TARGET_AFFINITY_CPU | AGO_TARGET_AFFINITY_GPU)
+	);
+
+/*! \brief AMD usernode callback for OpenCL source code generation. The framework will pass
+*   OpenVX objects as parameters to OpenCL kernels in othe order they appear to OpenVX node.
+*   The mapping of OpenVX object to OpenCL kernel argument as shown below:
+*     vx_image:       uint width, uint height, __global <type> * buf, uint stride_in_bytes, uint offset
+*     vx_array:       __global <type> * buf, uint offset_in_bytes, uint numitems
+*     vx_scalar:      float value or uint value or int value
+*     vx_matrix:      float matrix[<ROWS>*<COLS>]
+*     vx_convolution: float convolution[<ROWS>*<COLS>]
+*     vx_threshold:   int value or int2 value
+*     vx_remap:       __global short2 * buf, uint stride_in_bytes
+*     vx_lut:         __read_only image1d_t lut
+*/
+typedef vx_status(VX_CALLBACK * amd_kernel_opencl_codegen_callback_f) (
+	vx_node node,                                  // [input] node
+	const vx_reference parameters[],               // [input] parameters
+	vx_uint32 num,                                 // [input] number of parameters
+	bool opencl_load_function,                     // [input]  false: normal OpenCL kernel; true: reserved
+	char opencl_kernel_function_name[64],          // [output] kernel_name for clCreateKernel()
+	std::string& opencl_kernel_code,               // [output] string for clCreateProgramWithSource()
+	std::string& opencl_build_options,             // [output] options for clBuildProgram()
+	vx_uint32& opencl_work_dim,                    // [output] work_dim for clEnqueueNDRangeKernel()
+	vx_size opencl_global_work[],                  // [output] global_work[] for clEnqueueNDRangeKernel()
+	vx_size opencl_local_work[],                   // [output] local_work[] for clEnqueueNDRangeKernel()
+	vx_uint32& opencl_local_buffer_usage_mask,     // [output] reserved: must be ZERO
+	vx_uint32& opencl_local_buffer_size_in_bytes   // [output] reserved: must be ZERO
+	);
+
+/*! \brief AMD usernode callback for regenerating a node.
+*/
+typedef vx_status(VX_CALLBACK * amd_drama_add_node_f)(vx_node node, vx_enum kernel_id, vx_reference * paramList, vx_uint32 paramCount);
+typedef vx_status(VX_CALLBACK * amd_kernel_node_regen_callback_f)(vx_node node, amd_drama_add_node_f add_node_f, vx_bool& replace_original);
+
+/*! \brief AMD usernode callback for updating the OpenCL global_work[]. The framework will pass
+*   OpenVX objects as parameters to OpenCL kernels in othe order they appear to OpenVX node and
+*   previous values of local/global work. This function will get called before launching the kernel.
+*/
+typedef vx_status(VX_CALLBACK * amd_kernel_opencl_global_work_update_callback_f) (
+	vx_node node,                                  // [input] node
+	const vx_reference parameters[],               // [input] parameters
+	vx_uint32 num,                                 // [input] number of parameters
+	vx_uint32 opencl_work_dim,                     // [input] work_dim for clEnqueueNDRangeKernel()
+	vx_size opencl_global_work[],                  // [output] global_work[] for clEnqueueNDRangeKernel()
+	const vx_size opencl_local_work[]              // [input] local_work[] for clEnqueueNDRangeKernel()
+	);
+
+/*! \brief AMD usernode callback for setting the OpenCL buffers. The framework will pass
+*   OpenVX objects as parameters to OpenCL kernels in othe order they appear to OpenVX node.
+*   This function will get called before executing the node.
+*/
+typedef vx_status(VX_CALLBACK * amd_kernel_opencl_buffer_update_callback_f) (
+	vx_node node,                                  // [input] node
+	const vx_reference parameters[],               // [input] parameters
+	vx_uint32 num                                  // [input] number of parameters
+	);
+
+/*! \brief AMD data structure for use by VX_KERNEL_ATTRIBUTE_AMD_OPENCL_BUFFER_UPDATE_CALLBACK.
+*/
+typedef struct {
+	amd_kernel_opencl_buffer_update_callback_f opencl_buffer_update_callback_f;
+	vx_uint32 opencl_buffer_update_param_index;
+} AgoKernelOpenclBufferUpdateInfo;
+#endif
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/*==============================================================================
+    TENSOR DATA FUNCTIONS
+=============================================================================*/
+/*! \brief Allows the application to get direct access to a patch of tensor object.
+ * \param [in] tensor The reference to the tensor object that is the source or the
+ * destination of the copy.
+ * \param [in] num_of_dims The number of dimensions. Must be same as tensor num_of_dims.
+ * \param [in] roi_start An array of start values of the roi within the bounds of tensor. This is optional parameter and will be zero when NULL.
+ * \param [in] roi_end An array of end values of the roi within the bounds of tensor. This is optional parameter and will be dims[] of tensor when NULL.
+ * \param [out] map_id The address of a vx_map_id variable where the function returns a map identifier.
+ * \arg (*map_id) must eventually be provided as the map_id parameter of a call to <tt>\ref vxUnmapTensorPatch</tt>.
+ * \param [out] stride An array of stride in all dimensions in bytes.
+ * \param [out] ptr The address of a pointer that the function sets to the
+ * address where the requested data can be accessed. The returned (*ptr) address
+ * is only valid between the call to the function and the corresponding call to
+ * <tt>\ref vxUnmapTensorPatch</tt>.
+ * \param [in] usage This declares the access mode for the tensor patch, using
+ * the <tt>\ref vx_accessor_e</tt> enumeration.
+ * \arg VX_READ_ONLY: after the function call, the content of the memory location
+ * pointed by (*ptr) contains the tensor patch data. Writing into this memory location
+ * is forbidden and its behavior is undefined.
+ * \arg VX_READ_AND_WRITE : after the function call, the content of the memory
+ * location pointed by (*ptr) contains the tensor patch data; writing into this memory
+ * is allowed only for the location of items and will result in a modification of the
+ * affected items in the tensor object once the range is unmapped. Writing into
+ * a gap between items (when (*stride) > item size in bytes) is forbidden and its
+ * behavior is undefined.
+ * \arg VX_WRITE_ONLY: after the function call, the memory location pointed by (*ptr)
+ * contains undefined data; writing each item of the range is required prior to
+ * unmapping. Items not written by the application before unmap will become
+ * undefined after unmap, even if they were well defined before map. Like for
+ * VX_READ_AND_WRITE, writing into a gap between items is forbidden and its behavior
+ * is undefined.
+ * \param [in] mem_type A <tt>\ref vx_memory_type_e</tt> enumeration that
+ * specifies the type of the memory where the tensor patch is requested to be mapped.
+ * \param [in] flags An integer that allows passing options to the map operation.
+ * Use the <tt>\ref vx_map_flag_e</tt> enumeration.
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_ERROR_OPTIMIZED_AWAY This is a reference to a virtual tensor that cannot be accessed by the application.
+ * \retval VX_ERROR_INVALID_REFERENCE The tensor reference is not actually an tensor reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_tensor
+ * \post <tt>\ref vxUnmapTensorPatch </tt> with same (*map_id) value.
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxMapTensorPatch(vx_tensor tensor, vx_size num_of_dims, const vx_size * roi_start, const vx_size * roi_end, vx_map_id * map_id, vx_size * stride, void ** ptr, vx_enum usage, vx_enum mem_type, vx_uint32 flags);
+
+/*! \brief Unmap and commit potential changes to a tensor object patch that was previously mapped.
+ * Unmapping a tensor patch invalidates the memory location from which the patch could
+ * be accessed by the application. Accessing this memory location after the unmap function
+ * completes has an undefined behavior.
+ * \param [in] tensor The reference to the tensor object to unmap.
+ * \param [out] map_id The unique map identifier that was returned when calling
+ * <tt>\ref vxMapTensorPatch</tt> .
+ * \return A <tt>\ref vx_status_e</tt> enumeration.
+ * \retval VX_ERROR_INVALID_REFERENCE The tensor reference is not actually an tensor reference.
+ * \retval VX_ERROR_INVALID_PARAMETERS An other parameter is incorrect.
+ * \ingroup group_tensor
+ * \pre <tt>\ref vxMapTensorPatch</tt> returning the same map_id value
+ */
+VX_API_ENTRY vx_status VX_API_CALL vxUnmapTensorPatch(vx_tensor tensor, vx_map_id map_id);
+
+/*==============================================================================
+MISCELLANEOUS
+=============================================================================*/
+
+/**
+* \brief Retrieve the name of a reference
+* \ingroup vx_framework_reference
+*
+* This function is used to retrieve the name of a reference.
+*
+* \param [in] ref The reference.
+* \param [out] name Pointer to copy the name of the reference.
+* \param [in] size Size of the name buffer.
+* \return A \ref vx_status_e enumeration.
+* \retval VX_SUCCESS No errors.
+* \retval VX_ERROR_INVALID_REFERENCE if reference is not valid.
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxGetReferenceName(vx_reference ref, vx_char name[], vx_size size);
+
+/**
+* \brief Set module internal data.
+* \ingroup vx_framework_reference
+*
+* This function is used to set module specific internal data. This is for use by vxPublishKernels().
+*
+* \param [in] context The context.
+* \param [in] module The name of the module used in vxLoadKernels.
+* \param [in] ptr The module internal buffer.
+* \param [in] size Size of the module internal buffer.
+* \return A \ref vx_status_e enumeration.
+* \retval VX_SUCCESS No errors.
+* \retval VX_ERROR_INVALID_REFERENCE if reference is not valid.
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxSetModuleInternalData(vx_context context, const vx_char * module, void * ptr, vx_size size);
+
+/**
+* \brief Retrieve module internal data.
+* \ingroup vx_framework_reference
+*
+* This function is used to retrieve module specific internal data. This is for use by vxUnpublishKernels().
+*
+* \param [in] context The context.
+* \param [in] module The name of the module used in vxLoadKernels.
+* \param [out] ptr The module internal buffer.
+* \param [out] size Size of the module internal buffer.
+* \return A \ref vx_status_e enumeration.
+* \retval VX_SUCCESS No errors.
+* \retval VX_ERROR_INVALID_REFERENCE if reference is not valid.
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxGetModuleInternalData(vx_context context, const vx_char * module, void ** ptr, vx_size * size);
+
+/**
+* \brief Set module handle.
+* \ingroup vx_framework_reference
+*
+* This function is used to set module specific of a graph from within a node.
+*
+* \param [in] node The node.
+* \param [in] module The name of the module used in vxLoadKernels.
+* \param [in] ptr The module internal buffer.
+* \return A \ref vx_status_e enumeration.
+* \retval VX_SUCCESS No errors.
+* \retval VX_ERROR_INVALID_REFERENCE if reference is not valid.
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxSetModuleHandle(vx_node node, const vx_char * module, void * ptr);
+
+/**
+* \brief Retrieve module handle.
+* \ingroup vx_framework_reference
+*
+* This function is used to retrieve module specific handle of a graph from within a node.
+*
+* \param [in] node The node.
+* \param [in] module The name of the module used in vxLoadKernels.
+* \param [out] ptr The module internal buffer.
+* \return A \ref vx_status_e enumeration.
+* \retval VX_SUCCESS No errors.
+* \retval VX_ERROR_INVALID_REFERENCE if reference is not valid.
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxGetModuleHandle(vx_node node, const vx_char * module, void ** ptr);
+
+/**
+* \brief Set custom image format description.
+* \ingroup vx_framework_reference
+*
+* This function is used to support custom image formats with single-plane by ISVs. Should be called from vxPublishKernels().
+*
+* \param [in] context The context.
+* \param [in] format The image format.
+* \param [in] desc The image format description.
+* \return A \ref vx_status_e enumeration.
+* \retval VX_SUCCESS No errors.
+* \retval VX_ERROR_INVALID_REFERENCE if reference is not valid.
+* \retval VX_ERROR_INVALID_FORMAT if format is already in use.
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxSetContextImageFormatDescription(vx_context context, vx_df_image format, const AgoImageFormatDescription * desc);
+
+/**
+* \brief Get custom image format description.
+* \ingroup vx_framework_reference
+* \param [in] context The context.
+* \param [in] format The image format.
+* \param [out] desc The image format description.
+* \return A \ref vx_status_e enumeration.
+* \retval VX_SUCCESS No errors.
+* \retval VX_ERROR_INVALID_REFERENCE if reference is not valid.
+* \retval VX_ERROR_INVALID_FORMAT if format is already in use.
+*/
+VX_API_ENTRY vx_status VX_API_CALL vxGetContextImageFormatDescription(vx_context context, vx_df_image format, AgoImageFormatDescription * desc);
+
+/* Tensor */
+VX_API_ENTRY vx_tensor VX_API_CALL vxCreateTensorFromHandle(vx_context context, vx_size number_of_dims, const vx_size * dims, vx_enum data_type, vx_int8 fixed_point_position, const vx_size * stride, void * ptr, vx_enum memory_type);
+VX_API_ENTRY vx_status VX_API_CALL vxConfigTensorHandle(vx_tensor tensor, vx_size offset, void* new_ptr);
+VX_API_ENTRY vx_status VX_API_CALL vxSwapTensorHandle(vx_tensor tensor, void * new_ptr, void** prev_ptr);
+VX_API_ENTRY vx_status VX_API_CALL vxAliasTensor(vx_tensor tensorMaster, vx_size offset, vx_tensor tensor);
+VX_API_ENTRY vx_bool VX_API_CALL vxIsTensorAliased(vx_tensor tensorMaster, vx_size offset, vx_tensor tensor);
+
+/* extend for nna device */
+VX_API_ENTRY vx_graph VX_API_CALL vxGetScopeGraph(vx_reference reference);
+VX_API_ENTRY vx_bool VX_API_CALL vxGraphProfEnable(vx_graph graph);
+VX_API_ENTRY vx_size VX_API_CALL vxAllocateDeviceMemory(vx_context context, vx_size size);
+VX_API_ENTRY vx_status VX_API_CALL vxFreeDeviceMemory(vx_context context, vx_size handle);
+VX_API_ENTRY vx_size VX_API_CALL vxGetDeviceMemoryPhysicalAddress(vx_size handle);
+VX_API_ENTRY vx_size VX_API_CALL vxGetDeviceMemoryVirtualAddress(vx_size handle);
+VX_API_ENTRY vx_size VX_API_CALL vxGetDeviceMemorySize(vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxDeviceMemoryInfo(vx_context context, std::vector<vx_size>& mem_size, std::vector<vx_size>& virt_addr, std::vector<vx_size>& phys_addr);
+VX_API_ENTRY vx_status VX_API_CALL vxInvalidateDeviceMemoryCache(vx_context context, vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxInvalidateDeviceMemoryCacheAll(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxFlushDeviceMemoryCache(vx_context context, vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxFlushDeviceMemoryCacheAll(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxConfigCommandMemory(vx_graph graph, vx_size handle);
+VX_API_ENTRY vx_size VX_API_CALL vxGetCommandMemory(vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxConfigTensorMemory(vx_graph graph, vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxConfigDefaultInOutMemory(vx_graph graph, vx_size handle);
+VX_API_ENTRY vx_status VX_API_CALL vxConfigBaseInOutMemory(vx_graph graph, vx_size handle);
+VX_API_ENTRY vx_size VX_API_CALL vxGetDefaultInOutMemory(vx_graph graph);
+VX_API_ENTRY vx_size VX_API_CALL vxGetBaseInOutMemory(vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxSetCommandParams(vx_graph graph, int cmd_blk_num, int first_cmd_len, int offset, int length, bool on_chip_mem_enable, std::vector<int>& cmd_seq_num, std::vector<int> & cmd_ptr);
+VX_API_ENTRY vx_status VX_API_CALL vxQueueCommand(vx_context context, vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxProcessCommand(vx_context context, vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxPushGraphSoftBlockPerf(vx_graph graph, int time_eval);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphBlockType(vx_graph graph, int node_type, int block_idx);
+VX_API_ENTRY vx_size VX_API_CALL vxCreateHandleFromDeviceMemory(vx_context context, vx_size offset, vx_size length, vx_size dev_mem_handle);
+VX_API_ENTRY vx_status VX_API_CALL vxReleaseDeviceMemoryHandle(vx_context context, vx_size dev_mem_handle);
+VX_API_ENTRY vx_status VX_API_CALL vxVerifyDeviceMemoryHandle(vx_context context, vx_size dev_mem_handle);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphInputTensor(vx_graph graph, int batch_idx, bool final_output, std::string name, std::vector<int>& dims, int align_mode, vx_tensor tensor);
+VX_API_ENTRY vx_status VX_API_CALL vxGetGraphInputBlob(vx_graph graph, std::map<std::string, std::vector<vx_tensor>>& blobs, std::map<std::string, int>& blobs_align_mode, std::map<std::string, std::vector<int>>& blobs_raw_dims, std::map<std::string, std::vector<void*>>** blobs_raw_data);
+VX_API_ENTRY vx_status VX_API_CALL vxSetGraphOutputTensor(vx_graph graph, int batch_idx, bool final_output, std::string name, std::vector<int> & dims, int align_mode, vx_tensor tensor);
+VX_API_ENTRY vx_status VX_API_CALL vxGetGraphOutputBlob(vx_graph graph, std::vector<std::string>& names, std::map<std::string, std::vector<vx_tensor>>& blobs, std::map<std::string, int>& blobs_align_mode, std::map<std::string, std::vector<int>>& blobs_raw_dims, std::map<std::string, bool>& blobs_final, std::map<std::string, std::vector<void*>>** blobs_raw_data);
+VX_API_ENTRY vx_status VX_API_CALL vxStoreGraphInputBlobPosition(vx_graph graph, std::map<std::string, std::vector<int>>& input_data_pos, std::map<std::string, std::vector<std::vector<int>>>& input_cmd_pos);
+VX_API_ENTRY vx_status VX_API_CALL vxGetGraphInputBlobPosition(vx_graph graph, std::map<std::string, std::vector<int>>& input_data_pos, std::map<std::string, std::vector<std::vector<int>>>& input_cmd_pos);
+VX_API_ENTRY vx_status VX_API_CALL vxStoreGraphOutputBlobPosition(vx_graph graph, std::map<std::string, std::vector<int>>& output_data_pos, std::map<std::string, std::vector<int>>& output_cmd_pos);
+VX_API_ENTRY vx_status VX_API_CALL vxGetGraphOutputBlobPosition(vx_graph graph, std::map<std::string, std::vector<int>>& output_data_pos, std::map<std::string, std::vector<int>>& output_cmd_pos);
+
+VX_API_ENTRY vx_uint64 VX_API_CALL vxGetSysTime();
+VX_API_ENTRY vx_int32 VX_API_CALL vxGetDeviceID(vx_context context, const vx_char* dev_name);
+VX_API_ENTRY vx_int32 VX_API_CALL vxGetDeviceVersion(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxSetDeviceFreq(vx_context context, const vx_char* dev_name, int freq);
+VX_API_ENTRY vx_status VX_API_CALL vxGetDeviceFreq(vx_context context, const vx_char* dev_name, int* freq);
+VX_API_ENTRY vx_status VX_API_CALL vxSetDeviceTimeOut(vx_context context, const vx_char * dev_name, int timeout);
+VX_API_ENTRY vx_status VX_API_CALL vxGetDeviceTimeOut(vx_context context, const vx_char * dev_name, int * timeout);
+VX_API_ENTRY vx_status VX_API_CALL vxNpuDeviceRun(vx_context context, int cmd_blk_num, int first_cmd_len, int warp_in_align64, vx_size internal_phys_base_addr, vx_size input_phys_base_addr, vx_size output_phys_base_addr, vx_size size_of_cmd, vx_uint32* cmd);
+VX_API_ENTRY vx_status VX_API_CALL vxVpuDeviceRun(vx_context context, vx_enum vpu_op, void* cfgs, vx_size size_of_cfgs);
+VX_API_ENTRY vx_status VX_API_CALL vxProfileGraph(vx_graph graph);
+VX_API_ENTRY vx_status VX_API_CALL vxFinish(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxFlush(vx_context context);
+VX_API_ENTRY vx_status VX_API_CALL vxWaitSync(vx_context context, vx_graph graph);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif

+ 30 - 0
include_bakbak/VX_EXT/vx_log.h

@@ -0,0 +1,30 @@
+#ifndef __VX_LOG_H__
+#define __VX_LOG_H__
+
+#include <stdarg.h>
+#include <VX/vx.h>
+
+#ifdef ALOG_PRINT
+#include <log/log.h>
+#define VX_LOG(...)  ALOGE(__VA_ARGS__)
+#else
+#define VX_LOG(...)  printf(__VA_ARGS__)
+#endif
+
+#define ERROR_CHECK_STATUS( status ) { \
+        vx_status status_ = (status); \
+        if(status_ != VX_SUCCESS) { \
+            VX_LOG("ERROR: failed with status = (%d) at " __FILE__ "#%d\n", status_, __LINE__); \
+            exit(1); \
+        } \
+    }
+
+#define ERROR_CHECK_OBJECT( obj ) { \
+        vx_status status_ = vxGetStatus((vx_reference)(obj)); \
+        if(status_ != VX_SUCCESS) { \
+            VX_LOG("ERROR: failed with status = (%d) at " __FILE__ "#%d\n", status_, __LINE__); \
+            exit(1); \
+        } \
+    }
+
+#endif

+ 34 - 0
include_bakbak/ansjer_ai_cfg.h

@@ -0,0 +1,34 @@
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <vector>
+#include "tiny_json.h"
+
+#pragma once
+
+typedef struct ClassAttrsAll {
+    float conf_thresh;
+    float iou_thresh;
+}ClassAttrsAll_t;
+
+typedef struct Property {
+    char ezbStr[128];
+    char binStr[128];
+    
+    unsigned int anchors[18] ;
+    std::vector<std::string> label;
+    std::vector<std::string> yolo_outputs_name;
+    bool need_nu_freq;
+    int freq_nu;
+    bool need_vu_freq;
+    int freq_vu;
+}Property_t;
+
+typedef struct Asj_Ai_Cfg {
+    Property property;
+    ClassAttrsAll class_attrs_all;
+}Asj_Ai_Cfg_t;
+
+int read_Asj_Ai_Json (void *hdl,char *filename);

+ 7 - 0
include_bakbak/ax_config.h

@@ -0,0 +1,7 @@
+#ifndef _AX_CONFIG_H
+#define _AX_CONFIG_H
+
+#define __VX2021__
+
+
+#endif

+ 32 - 0
include_bakbak/ax_test_utils.h

@@ -0,0 +1,32 @@
+#ifndef __AX_TEST_UTILS_H__
+#define __AX_TEST_UTILS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "eznn_api.h"
+#ifdef __EOS__
+#include <rtthread.h>
+#include <debug.h>
+#endif
+
+
+int drawrectback(char *y, int w, ezax_rt_t *pRect);
+int drawrectback_c(char *y, int w, ezax_rt_t *pRect, int color);
+int draw_rect_with_color(char *y, int w, int h, ezax_rt_t *pRect, int color);
+void *ax_malloc_uncache(unsigned int *phy_addr, int size);
+int ax_free_uncache(unsigned int phy_addr, void *viraddr);
+void *ax_realloc_virt(void *prt, int size);
+void *ax_malloc_virt(int size);
+int ax_free_virt(void *prt);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif

+ 561 - 0
include_bakbak/ax_type.h

@@ -0,0 +1,561 @@
+#ifndef _AX_TYPE_H
+#define _AX_TYPE_H
+#include "ax_config.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+
+#define YUV420 YUV420_SP
+#define YVU420 YVU420_SP
+
+
+//#define MALLOC_CHECK
+
+void *AX_MALLOC_RECORD(int size);
+void AX_FREE_RECORD(void *ptr);
+
+void *AX_MALLOC_DEBUG(const char *func, int line, int size);
+void AX_FREE_DEBUG(void *ptr);
+
+void DUMP_AX_MEM_LIST_INFO(int flag);
+void AX_CHECK_MEM_BOUND();
+
+#ifdef MALLOC_CHECK
+#define AX_MALLOC(sz) AX_MALLOC_DEBUG(__func__, __LINE__, sz)
+#define AX_FREE(ptr)  AX_FREE_DEBUG(ptr)
+#else
+#define AX_MALLOC(sz) AX_MALLOC_RECORD(sz)
+#define AX_FREE(ptr)  AX_FREE_RECORD(ptr)
+#endif
+
+#define AX_MALLOC_FAIL_LOG(mem) printf("AX MALLOC "#mem".p fail\n")
+
+template <class T>
+void AX_MALLOC_INC_TEMP(T &mem, int required_size)
+{
+	(mem).size = (required_size);
+	int origin_len_1220 = 0;
+	if((mem).p)
+	{
+		origin_len_1220 = *(((int*)(mem).p) - 1);
+	} 
+	int required_len_1220 = (required_size) * sizeof((mem).p[0]);
+	if(((mem).p == NULL && required_len_1220 > 0) || required_len_1220 > origin_len_1220)
+	{
+		int required_enlarge_len_1220 = required_len_1220 ;
+		if((mem).p)
+		{
+			AX_FREE((mem).p);
+			(mem).p = 0;
+		}
+#ifdef _MSC_VER
+		(mem).p=(decltype((mem).p))AX_MALLOC(required_enlarge_len_1220);
+#else
+		(mem).p = (typeof((mem).p))AX_MALLOC(required_enlarge_len_1220);
+#endif
+		if ((mem).p == NULL)
+		{
+			(mem).size = 0;
+		}
+	}
+}
+
+
+#define AX_MALLOC_INC(mem, type, required_size) AX_MALLOC_INC_TEMP(mem, (required_size))
+
+
+template <class T>
+void AX_MALLOC_INC_2D(T &mem)
+{
+	int required_size = mem.size.width * mem.size.height;
+	int origin_len_1220 = 0;
+	if((mem).p)
+	{
+		origin_len_1220 = *(((int*)(mem).p) - 1);
+	} 
+	int required_len_1220 = (required_size) * sizeof((mem).p[0]);
+	if(((mem).p == NULL && required_len_1220 > 0) || required_len_1220 > origin_len_1220)
+	{
+		int required_enlarge_len_1220 = required_len_1220 ;
+		if((mem).p)
+		{
+			AX_FREE((mem).p);
+			(mem).p = 0;
+		}
+#ifdef _MSC_VER
+		(mem).p=(decltype((mem).p))AX_MALLOC(required_enlarge_len_1220);
+#else
+		(mem).p = (typeof((mem).p))AX_MALLOC(required_enlarge_len_1220);
+#endif
+	}
+}
+
+#ifndef MAX
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+#endif
+#ifndef MIN
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
+#endif
+
+#ifndef ROUND
+#define ROUND(f) (  ((f)>=0)?((int)((f)+0.5)):((int)((f)-0.5)) )
+#endif
+
+#ifndef CLIPMINMAX
+#define CLIPMINMAX(v,mn,mx)				\
+{										\
+		if ((v)<(mn))		{(v)=(mn);}\
+		else if((v)>(mx))	{(v)=(mx);}\
+}
+#endif
+
+
+
+
+template <class T1, class T2>
+T2* ax_buffer_get(T1 &b, int index)
+{
+	if(b.size == 0)
+	{
+		return NULL;
+	}
+	int temp_index = b.cur - b.size + 1 + index;
+	if (temp_index >= 0)
+	{
+		return &b.buffers[temp_index];
+	}
+	else
+	{
+		return &b.buffers[temp_index+b.capacity];
+	}
+}
+template <class T1, class T2>
+T2* ax_buffer_get_back(T1 &b)
+{
+	return ax_buffer_get<T1, T2>(b, b.size-1);
+}
+
+template <class T1, class T2>
+void ax_buffer_push_back(T1 &b, T2 &element)
+{
+	if (b.size == 0) 
+	{
+		b.cur = -1; 
+	} 
+	b.cur++; 
+	if (b.cur >= b.capacity) 
+	{ 
+		b.cur = 0; \
+	} 
+	b.buffers[b.cur] = element; 
+	b.size++; 
+	if (b.size > b.capacity)
+	{
+		b.size = b.capacity;
+	}
+}
+
+template <class T1, class T2>
+T2 *ax_buffer_pop_back(T1 &b)
+{
+	 
+}
+
+
+#define AX_BUFFER_GET(b, type, index) (((b).cur-(b).size+1+index >= 0)?((type*)&(b).buffers[(b).cur-(b).size+1+index]):((type*)&(b).buffers[(b).cur-(b).size+1+index+(b).capacity])) 
+#define AX_BUFFER_PUSH_BACK(b, element) { \
+	if((b).size==0) \
+	{\
+		(b).cur=-1;\
+	} \
+	(b).cur++;\
+	if((b).cur >= (b).capacity) \
+	{ \
+		(b).cur = 0; \
+	} \
+	(b).buffers[(b).cur] = element;\
+	(b).size++; \
+	if((b).size > (b).capacity) \
+		(b).size=(b).capacity; \
+	}\
+
+#define AX_BUFFER_RESET(b) { \
+	(b).cur=-1; \
+	(b).size=0; \
+	}
+
+
+template <class T1>
+void AX_ARRAY_ZERO(T1 &mem)
+{
+	memset(mem.p, 0, sizeof(mem.p[0]) * mem.size);
+}
+
+
+template <class T1, class T2>
+void AX_ARRAY_PUSH_BACK(T1 &mem, T2 &elem)
+{
+	int required_size = mem.size + 1;
+	int origin_len = 0;
+	if(mem.p)
+	{
+		origin_len = *(((int*)(mem).p) - 1);
+	}
+	int required_len = (required_size) * sizeof((mem).p[0]);
+	if(((mem).p == NULL && required_len > 0) || required_len > origin_len)
+	{
+		int required_enlarge_len = required_len * 2;
+		void *temp_ptr = AX_MALLOC(required_enlarge_len);
+
+		if((mem).p)
+		{
+			memcpy(temp_ptr, mem.p, origin_len);
+			AX_FREE(mem.p);
+		}
+#ifdef _MSC_VER
+		mem.p = (decltype((mem).p))temp_ptr;
+#else
+		mem.p=(typeof((mem).p))temp_ptr;
+#endif
+	}
+	mem.p[mem.size] = elem;
+	mem.size = required_size;
+}
+
+template <class T1>
+void AX_ARRAY_CLEAR(T1 &mem)
+{
+	mem.size = 0;
+}
+
+template <class T1>
+void AX_ARRAY_RELEASE(T1 &mem)
+{
+	AX_FREE(mem.p);
+	mem.p = NULL;
+	mem.size = 0;
+}
+
+/*deep copy*/
+template <class T1>
+void AX_ARRAY_COPY(T1 &src, T1 &dst)
+{
+	AX_MALLOC_INC_TEMP(dst, src.size);
+	memcpy(dst.p, src.p, sizeof(src.p[0]) * src.size);
+}
+
+
+
+enum {
+	AX_INT8 = 0,
+	AX_UINT8 = 1,
+	AX_INT16 = 2,
+	AX_UINT16 = 3,
+	AX_INT32 = 4,
+	AX_UINT32 = 5,
+	AX_FLOAT32 = 6,
+	AX_FLOAT64 = 7,
+};
+
+
+#if defined _STDINT || defined __EOS__
+
+#else
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned int uint32_t;
+#endif
+typedef float float32_t;
+typedef double float64_t;
+typedef unsigned short ushort;
+
+
+
+#ifndef _AX_RECT_T
+#define _AX_RECT_T
+typedef struct
+{
+	int x;
+	int y;
+	int width;
+	int height;
+} ax_rect_t;
+#endif
+
+#ifndef _AX_BOX_T
+#define _AX_BOX_T
+typedef struct
+{
+	int x1;
+	int y1;
+	int x2;
+	int y2;
+} ax_box_t;
+#endif
+
+
+#ifndef _AX_SIZE_T
+#define _AX_SIZE_T
+typedef struct
+{
+	int width;
+	int height;
+} ax_size_t;
+#endif
+
+#ifndef _AX_SIZE_F_T
+#define _AX_SIZE_F_T
+typedef struct
+{
+	float width;
+	float height;
+} ax_sizef_t;
+#endif
+
+#ifndef _AX_POINTU16_T
+#define _AX_POINTU16_T
+typedef struct {
+	unsigned short x;
+	unsigned short y;
+} ax_pointu16_t;
+#endif
+
+#ifndef _AX_POINTS16_T
+#define _AX_POINTS16_T
+typedef struct {
+	short x;
+	short y;
+} ax_points16_t;
+#endif
+
+typedef struct
+{
+	ax_points16_t *p;
+	int size;
+} ax_points16_array_t;
+
+#ifndef _AX_POINT_T
+#define _AX_POINT_T
+typedef struct {
+	int x;
+	int y;
+} ax_point_t;
+#endif
+
+
+#ifndef _AX_POINT_2F_T
+#define _AX_POINT_2F_T
+typedef struct {
+	float x;
+	float y;
+} ax_pointf_t;
+#endif
+
+#ifndef _AX_POINT_2D_T
+#define _AX_POINT_2D_T
+typedef struct {
+	double x;
+	double y;
+} ax_pointd_t;
+#endif
+
+#ifndef _AX_POINT_3D_T
+#define _AX_POINT_3D_T
+typedef struct {
+	double x;
+	double y;
+	double z;
+} ax_point3d_t;
+#endif
+
+#ifndef _AX_BBOX_T
+#define _AX_BBOX_T
+typedef struct {
+	int x1;
+	int y1;
+	int x2;
+	int y2;
+} ax_bbox_t;
+#endif
+
+
+#ifndef _AX_YUV_T
+#define _AX_YUV_T
+typedef struct
+{
+	void *y;
+	void *uv;
+	void *y_phy;
+	void *uv_phy;
+	int stride1;
+	int stride2;
+	ax_size_t size;
+	img_fmt format;
+} ax_yuv_t;
+#endif
+
+
+
+#ifndef _AX_INT_ARRAY_T
+#define _AX_INT_ARRAY_T
+typedef struct
+{
+	int *p;
+	int size;
+} ax_int_array_t;
+
+#endif
+
+#ifndef _UINT_ARRAY_T
+#define _UINT_ARRAY_T
+typedef struct
+{
+	unsigned int *p;
+	int size;
+} ax_uint_array_t;
+#endif
+
+
+#ifndef _AX_INT8_ARRAY_T
+#define _AX_INT8_ARRAY_T
+typedef struct
+{
+	int8_t *p;
+	int size;
+} ax_int8_array_t;
+#endif
+
+#ifndef _AX_DOUBLE_ARRAY_T
+#define _AX_DOUBLE_ARRAY_T
+typedef struct
+{
+	double *p;
+	int size;
+} ax_double_array_t;
+#endif
+
+#ifndef _AX_FLOAT_ARRAY_T
+#define _AX_FLOAT_ARRAY_T
+typedef struct
+{
+	float *p;
+	int size;
+} ax_float_array_t;
+#endif
+
+#ifndef _UCHAR_MATRIX_T
+#define _UCHAR_MATRIX_T
+typedef struct
+{
+	unsigned char *p;
+	ax_size_t size;
+} ax_uchar_matrix_t;
+#endif
+
+typedef ax_uchar_matrix_t ax_gray_t;
+
+#ifndef _USHORT_ARRAY_T
+#define _USHORT_ARRAY_T
+typedef struct
+{
+	unsigned short *p;
+	int size;
+} ax_ushort_array_t;
+#endif
+
+
+#ifndef __AX_DETECT_BOX_T_
+#define __AX_DETECT_BOX_T__
+typedef struct
+{
+	int   x1;
+	int   y1;
+	int   x2;
+	int   y2;
+	int   class_idx;
+	int   origin_class_idx;
+	float score;
+} ax_detect_box_t;
+#endif
+
+
+#ifndef __AX_TRACK_BOX_T__
+#define __AX_TRACK_BOX_T__
+typedef struct
+{
+	int   id;
+	int   x1;
+	int   y1;
+	int   x2;
+	int   y2;
+} ax_track_box_t;
+#endif
+
+#ifndef __AX_DETECT_BOX_ARRAY_T__
+#define __AX_DETECT_BOX_ARRAY_T__
+typedef struct
+{
+	ax_detect_box_t *p;
+	int size;
+} ax_detect_box_array_t;
+#endif
+
+
+class ax_tensor_mem_t
+{
+public:
+	ax_tensor_mem_t();
+	ax_tensor_mem_t(int len);
+	void *alloc_mem(int len);
+	~ax_tensor_mem_t();
+
+	void *data;
+	ax_tensor_mem_t(const ax_tensor_mem_t &m);
+	ax_tensor_mem_t& operator = (const ax_tensor_mem_t &m);
+
+	int len;
+private:
+	int *refcount;
+	void release();
+};
+
+class ax_tensor_t
+{
+public:
+	ax_tensor_t();
+	ax_tensor_t(const ax_tensor_t &m);
+	ax_tensor_t(int num, int channel, int row, int col, int dtype);
+	ax_tensor_t(int *dims, int dtype);
+	~ax_tensor_t();
+	int numel();
+	int dims[4];
+	void *data;
+	int  dtype;
+	double fix_scale; /*available only when dtype == INT8 */
+
+	ax_tensor_t convert(int dtype);
+	ax_tensor_t mul(double scale);
+	ax_tensor_t copy();
+	void set_to(double value);
+	void set_fix_scale(double fix_scale);
+	//private:
+	ax_tensor_mem_t mem;
+	void create(int *dims, int dtype);
+	void create(int *dims, int dtype, void *ptr);
+
+	template <typename _Tp> inline _Tp* ptr(int dim0 = 0, int dim1 = 0, int dim2 = 0, int dim3 = 0){
+		int step2 = dims[3];
+		int step1 = dims[2] * step2;
+		int step0 = dims[1] * step1;
+		return (_Tp*)data + dim0 * step0 + dim1 * step1 + dim2 * step2 + dim3;
+	}
+
+	double norm();
+	double dot(ax_tensor_t &t2);
+};
+
+#endif

+ 136 - 0
include_bakbak/eznn_api.h

@@ -0,0 +1,136 @@
+#ifndef _EZNN_API_H_
+#define _EZNN_API_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifndef MAX_CLASSIFICATION_DET_NUM
+#define MAX_CLASSIFICATION_DET_NUM 256
+#endif
+
+
+typedef enum EzaxImageFormat_e {
+	EZAX_YUV420_SP = 0x02,
+	EZAX_YVU420_SP = 0x04,
+	EZAX_BGRA  = 0x09,
+} ezax_img_fmt_e;
+
+
+typedef struct ezax_imres
+{
+	/* picture resolution */
+	int w; int h;
+}ezax_imres_t;
+
+
+typedef struct ezax_freq
+{
+	/*dev_id; freq*/
+	int id; int freq;
+}ezax_freq_t;
+
+
+typedef struct ezax_rt
+{
+	/* left top */
+	int x0;	int y0;
+	/* right bottom */
+	int x1;	int y1;
+	/* class */
+	int c;
+	/* score */
+	float s;
+	/* id */
+	int id;
+	/* area */
+	int area;
+	/* exit */
+	int exist;
+	/* input extern information such as ezax_face_kpts_t */
+	void *in_ex_inform;
+	/* output extern information*/
+	void *out_ex_inform;
+	/* rsved */
+	int rev;
+}ezax_rt_t;
+
+
+typedef struct ezax_boxes
+{
+	/* roi boxes */
+	ezax_rt_t *pRect;
+	/* rect num */
+	int num;
+	/* */
+	unsigned int nUID;
+	/* rzv inform */
+	void *rzv;
+}ezax_boxes_t;
+
+
+typedef struct ezax_img_handle {
+	/* vir addr*/
+	void *pVir;
+	void *pVir_UV;
+	/* phy addr*/
+	unsigned int pPhy;
+	unsigned int pPhy_UV;
+	/* size */
+	int sz;
+	/* fmt */
+	int fmt;
+	/* iw */
+	int w;
+	/* ih */
+	int h;
+	/* channels */
+	int c;
+	/* wstride */
+	int stride;
+	/* color matrixs */
+	int csc_mode;
+} ezax_img_handle_t;
+
+typedef struct ezax_img
+{
+	/* img_handle */
+	ezax_img_handle_t img_handle;
+	/* valid roi */
+	ezax_rt_t roi;
+	/* input extern information such as ezax_face_kpts_t*/
+	unsigned int nUID;
+	/* reved */
+	unsigned int rzv;
+}ezax_img_t;
+
+
+typedef struct ezax_img_batch
+{
+	/* batch images */
+	ezax_img_t *pImg;
+	/* batch num */
+	unsigned int nNum;
+}ezax_img_batch_t;
+
+
+typedef struct ezax_img_rois
+{
+	/* img_handle */
+	ezax_img_handle_t img_handle;
+	/* valid roi */
+	ezax_rt_t *roi;
+	/* roi num */
+	int roi_num;
+	/* */
+	unsigned int nUID;
+	/* reserved */
+	unsigned int rzv;
+}ezax_img_rois_t;
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif

+ 11 - 0
include_bakbak/libnn/img_type.h

@@ -0,0 +1,11 @@
+#ifndef _IMG_TYPE_H_
+#define _IMG_TYPE_H_
+
+
+typedef enum ImageFormat_E {
+	YUV420_SP = 0x02,
+	YVU420_SP = 0x04,
+	NNA_BGRA  = 0x09,
+} img_fmt;
+
+#endif

+ 269 - 0
include_bakbak/libnn/net_api.h

@@ -0,0 +1,269 @@
+#ifndef _NET_API_H_
+#define _NET_API_H_
+
+#include <vector>
+#include <VX/vx.h>
+#include <vx_ext_amd.h>
+#include "img_type.h"
+// typedef enum ImageFormat_E {
+// 	YUV420_SP = 0x02,
+// 	YVU420_SP = 0x04,
+// 	NNA_BGRA  = 0x09,
+// 	NNA_GRAY  = 0x07,
+// } img_fmt;
+
+typedef enum ImageOperation_E {
+	CVT  = 1001,
+	WARP = 1002,
+} img_op;
+
+typedef enum ImageDataLayout_E {
+	CHW = 2001,
+	HWC = 2002,
+	WHC = 2003,
+} img_data_layout;
+
+typedef struct ImageConvertParam_S {
+	img_fmt input_fmt;
+	int input_width;
+	int input_height;
+	int input_stride;
+	int input_crop_x;
+	int input_crop_y;
+	int input_crop_w;
+	int input_crop_h;
+	int input_color_range;
+	img_fmt output_fmt;
+	int output_width;
+	int output_height;
+} img_cvt_param;
+
+typedef struct MbgParam_S {
+	int input_width;
+	int input_height;
+	int blk_width;
+	int blk_height;
+	int threshold_enable;
+	int threshold;
+	int alpha;
+	int reset_flag;
+	int mask_threshold;
+} mbg_param;
+
+typedef struct ImageWarpParam_S {
+	img_fmt input_fmt;
+	int input_width;
+	int input_height;
+	int input_stride;
+	int flip;
+	float mat[6];
+	int output_crop_x;
+	int output_crop_y;
+	int output_crop_w;
+	int output_crop_h;
+} img_warp_param;
+
+typedef struct InputImage_S {
+	img_op op;
+	img_fmt fmt;
+	int width;
+	int height;
+	int stride;
+	union {
+		struct {
+			int crop_x;
+			int crop_y;
+			int crop_w;
+			int crop_h;
+			int color_range;
+		} cvt_param;
+		struct {
+			int flip;
+			int crop_x;
+			int crop_y;
+			int crop_w;
+			int crop_h;
+			float mat[6];
+		} warp_param;
+	} u;
+	vx_size phys_addr;
+	vx_size phys_addr_uv;
+} input_image;
+
+typedef enum NetDataLayout_E {
+	NCHW = 3001,
+	NHWC = 3002,
+	NWHC = 3003,
+	CPKT = 3004,
+} net_data_layout;
+
+typedef enum NetDataType_E {
+	DINT8    = 4001,
+	DINT16   = 4002,
+	DFLOAT32 = 4003,
+} net_data_type;
+
+typedef struct NetBlobData_S {
+	net_data_type type;
+	int fixed_pos;
+	int cpkt_mode;
+	int dims[4];
+	int size;
+	void * data;
+} net_blob_data;
+
+/*
+ * network
+ */
+VX_API_ENTRY vx_graph VX_API_CALL CreateNetGraph(
+	vx_context context,
+	vx_uint32 * net_topo,
+	vx_int8 * net_blobs,
+	bool on_chip_mem_enable = false,
+	int hold_block_idx = 0x7FFFFFFF,
+	int up_to_block_count = -1);
+
+VX_API_ENTRY vx_status VX_API_CALL GetNetInputBlob(
+	vx_graph graph,
+	std::vector<std::string> & names,
+	std::vector<vx_tensor> & blobs);
+
+VX_API_ENTRY vx_status VX_API_CALL GetNetOutputBlob(
+	vx_graph graph,
+	std::vector<std::string> & names,
+	std::vector<vx_tensor> & blobs);
+
+VX_API_ENTRY vx_status VX_API_CALL GetNetIntermediateBlob(
+	vx_graph graph,
+	std::vector<std::string>& names,
+	std::vector<vx_tensor>& blobs);
+
+/*
+ * batch network
+ */
+VX_API_ENTRY vx_graph VX_API_CALL CreateBatchNetGraph(
+	vx_context context,
+	vx_uint32* net_topo,
+	vx_int8* net_blobs,
+	int batch);
+
+VX_API_ENTRY vx_status VX_API_CALL GetBatchNetInputBlob(
+	vx_graph graph,
+	std::vector<std::string>& names,
+	std::vector<std::vector<vx_tensor>>& blobs);
+
+VX_API_ENTRY vx_status VX_API_CALL GetBatchNetOutputBlob(
+	vx_graph graph,
+	std::vector<std::string>& names,
+	std::vector<std::vector<vx_tensor>>& blobs);
+
+/*
+ * config input and output buffer
+ */
+VX_API_ENTRY vx_status VX_API_CALL ConfigNetInOutBuffer(
+	vx_graph graph,
+	std::string& blob_name,
+	int offset,
+	vx_size handle,
+	int batch_idx = 0);
+
+VX_API_ENTRY vx_status VX_API_CALL ResetNetInOutBuffer(
+	vx_graph graph);
+
+/*
+ * import and export network data
+ */
+VX_API_ENTRY vx_status VX_API_CALL ImportNetInputDataFromImage(
+	vx_graph graph,
+	std::string& blob_name,
+	input_image* image,
+	int batch_idx = 0);
+
+VX_API_ENTRY vx_status VX_API_CALL ImportNetInputDataFromDataFile(
+	vx_graph graph,
+	std::string& blob_name,
+	char* fname,
+	int batch_idx = 0);
+
+VX_API_ENTRY vx_status VX_API_CALL ExportNetBlobData(
+	vx_graph graph,
+	net_data_layout layout,
+	std::string& blob_name,
+	net_blob_data* blob_data,
+	int batch_idx = 0);
+
+/*
+ * image process
+ */
+VX_API_ENTRY vx_size VX_API_CALL AllocDeviceImageBuffer(
+	vx_context context,
+	img_fmt fmt,
+	int width,
+	int height);
+
+VX_API_ENTRY vx_size VX_API_CALL AllocDeviceMbgMaskImageBuffer(
+	vx_context context,
+	int width,
+	int height,
+	int blk_width,
+	int blk_height);
+
+VX_API_ENTRY vx_status VX_API_CALL FreeDeviceImageBuffer(
+	vx_context context,
+	vx_size handle);
+
+VX_API_ENTRY vx_status VX_API_CALL ImageConvert(
+	vx_context context,
+	img_cvt_param * param,
+	vx_size input_phys_addr,
+	vx_size input_phys_addr_uv,
+	vx_size output_handle);
+
+VX_API_ENTRY vx_status VX_API_CALL BackgroundModeling(
+	vx_context context,
+	mbg_param * param,
+	vx_size input_phys_addr,
+	vx_size input_phys_addr_bg,
+	vx_size output_handle_bg,
+	vx_size output_handle_mask);
+
+VX_API_ENTRY vx_status VX_API_CALL ImageWarp(
+	vx_context context,
+	img_warp_param * param,
+	vx_size input_phys_addr,
+	vx_size input_phys_addr_uv,
+	vx_size output_handle);
+
+VX_API_ENTRY vx_status VX_API_CALL RgbImageConvert(
+	int w,
+	int h,
+	img_data_layout layout,
+	vx_uint8 * src,
+	vx_uint8 * dst);
+
+VX_API_ENTRY vx_status VX_API_CALL RgbImageRevert(
+	int w,
+	int h,
+	vx_uint8 * src,
+	img_data_layout layout,
+	vx_uint8 * dst);
+
+/*
+ * utility
+ */
+VX_API_ENTRY vx_status VX_API_CALL LoadNetModel(
+	vx_context context,
+	const char * model_file,
+	bool encrypted,
+	vx_int8 ** model);
+
+VX_API_ENTRY vx_status VX_API_CALL LoadNetModelFromMem(
+	vx_context context,
+	vx_int8 * model_data,
+	int model_len,
+	bool encrypted,
+	vx_int8 ** model);
+
+VX_API_ENTRY vx_status VX_API_CALL UnLoadNetModel(vx_int8 * model);
+
+#endif

+ 461 - 0
include_bakbak/tiny_json.c

@@ -0,0 +1,461 @@
+
+/*
+
+<https://github.com/rafagafe/tiny-json>
+
+  Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+  SPDX-License-Identifier: MIT
+  Copyright (c) 2016-2018 Rafa Garcia <rafagarcia77@gmail.com>.
+
+  Permission is hereby  granted, free of charge, to any  person obtaining a copy
+  of this software and associated  documentation files (the "Software"), to deal
+  in the Software  without restriction, including without  limitation the rights
+  to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+  copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in all
+  copies or substantial portions of the Software.
+
+  THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+  IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+  FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+  AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+  LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+
+*/
+
+#include <string.h>
+#include <ctype.h>
+#include "tiny_json.h"
+
+/** Structure to handle a heap of JSON properties. */
+typedef struct jsonStaticPool_s {
+    json_t* mem;      /**< Pointer to array of json properties.      */
+    unsigned int qty; /**< Length of the array of json properties.   */
+    unsigned int nextFree;  /**< The index of the next free json property. */
+    jsonPool_t pool;
+} jsonStaticPool_t;
+
+/* Search a property by its name in a JSON object. */
+json_t const* json_getProperty( json_t const* obj, char const* property ) {
+    json_t const* sibling;
+    for( sibling = obj->u.c.child; sibling; sibling = sibling->sibling )
+        if ( sibling->name && !strcmp( sibling->name, property ) )
+            return sibling;
+    return 0;
+}
+
+/* Search a property by its name in a JSON object and return its value. */
+char const* json_getPropertyValue( json_t const* obj, char const* property ) {
+	json_t const* field = json_getProperty( obj, property );
+	if ( !field ) return 0;
+        jsonType_t type = json_getType( field );
+        if ( JSON_ARRAY >= type ) return 0;
+	return json_getValue( field );
+}
+
+/* Internal prototypes: */
+static char* goBlank( char* str );
+static char* goNum( char* str );
+static json_t* poolInit( jsonPool_t* pool );
+static json_t* poolAlloc( jsonPool_t* pool );
+static char* objValue( char* ptr, json_t* obj, jsonPool_t* pool );
+static char* setToNull( char* ch );
+static bool isEndOfPrimitive( char ch );
+
+/* Parse a string to get a json. */
+json_t const* json_createWithPool( char *str, jsonPool_t *pool ) {
+    char* ptr = goBlank( str );
+    if ( !ptr || (*ptr != '{' && *ptr != '[') ) return 0;
+    json_t* obj = pool->init( pool );
+    obj->name    = 0;
+    obj->sibling = 0;
+    obj->u.c.child = 0;
+    ptr = objValue( ptr, obj, pool );
+    if ( !ptr ) return 0;
+    return obj;
+}
+
+/* Parse a string to get a json. */
+json_t const* json_create( char* str, json_t mem[], unsigned int qty ) {
+    jsonStaticPool_t spool;
+    spool.mem = mem;
+    spool.qty = qty;
+    spool.pool.init = poolInit;
+    spool.pool.alloc = poolAlloc;
+    return json_createWithPool( str, &spool.pool );
+}
+
+/** Get a special character with its escape character. Examples:
+  * 'b' -> '\\b', 'n' -> '\\n', 't' -> '\\t'
+  * @param ch The escape character.
+  * @retval  The character code. */
+static char getEscape( char ch ) {
+    static struct { char ch; char code; } const pair[] = {
+        { '\"', '\"' }, { '\\', '\\' },
+        { '/',  '/'  }, { 'b',  '\b' },
+        { 'f',  '\f' }, { 'n',  '\n' },
+        { 'r',  '\r' }, { 't',  '\t' },
+    };
+    unsigned int i;
+    for( i = 0; i < sizeof pair / sizeof *pair; ++i )
+        if ( pair[i].ch == ch )
+            return pair[i].code;
+    return '\0';
+}
+
+/** Parse 4 characters.
+  * @param str Pointer to  first digit.
+  * @retval '?' If the four characters are hexadecimal digits.
+  * @retval '\0' In other cases. */
+static unsigned char getCharFromUnicode( unsigned char const* str ) {
+    unsigned int i;
+    for( i = 0; i < 4; ++i )
+        if ( !isxdigit( str[i] ) )
+            return '\0';
+    return '?';
+}
+
+/** Parse a string and replace the scape characters by their meaning characters.
+  * This parser stops when finds the character '\"'. Then replaces '\"' by '\0'.
+  * @param str Pointer to first character.
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* parseString( char* str ) {
+    unsigned char* head = (unsigned char*)str;
+    unsigned char* tail = (unsigned char*)str;
+    for( ; *head; ++head, ++tail ) {
+        if ( *head == '\"' ) {
+            *tail = '\0';
+            return (char*)++head;
+        }
+        if ( *head == '\\' ) {
+            if ( *++head == 'u' ) {
+                char const ch = getCharFromUnicode( ++head );
+                if ( ch == '\0' ) return 0;
+                *tail = ch;
+                head += 3;
+            }
+            else {
+                char const esc = getEscape( *head );
+                if ( esc == '\0' ) return 0;
+                *tail = esc;
+            }
+        }
+        else *tail = *head;
+    }
+    return 0;
+}
+
+/** Parse a string to get the name of a property.
+  * @param ptr Pointer to first character.
+  * @param property The property to assign the name.
+  * @retval Pointer to first of property value. If success.
+  * @retval Null pointer if any error occur. */
+static char* propertyName( char* ptr, json_t* property ) {
+    property->name = ++ptr;
+    ptr = parseString( ptr );
+    if ( !ptr ) return 0;
+    ptr = goBlank( ptr );
+    if ( !ptr ) return 0;
+    if ( *ptr++ != ':' ) return 0;
+    return goBlank( ptr );
+}
+
+/** Parse a string to get the value of a property when its type is JSON_TEXT.
+  * @param ptr Pointer to first character ('\"').
+  * @param property The property to assign the name.
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* textValue( char* ptr, json_t* property ) {
+    ++property->u.value;
+    ptr = parseString( ++ptr );
+    if ( !ptr ) return 0;
+    property->type = JSON_TEXT;
+    return ptr;
+}
+
+/** Compare two strings until get the null character in the second one.
+  * @param ptr sub string
+  * @param str main string
+  * @retval Pointer to next character.
+  * @retval Null pointer if any error occur. */
+static char* checkStr( char* ptr, char const* str ) {
+    while( *str )
+        if ( *ptr++ != *str++ )
+            return 0;
+    return ptr;
+}
+
+/** Parser a string to get a primitive value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type, (true, false or null).
+  * @param value String with the primitive literal.
+  * @param type The code of the type. ( JSON_BOOLEAN or JSON_NULL )
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* primitiveValue( char* ptr, json_t* property, char const* value, jsonType_t type ) {
+    ptr = checkStr( ptr, value );
+    if ( !ptr || !isEndOfPrimitive( *ptr ) ) return 0;
+    ptr = setToNull( ptr );
+    property->type = type;
+    return ptr;
+}
+
+/** Parser a string to get a true value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type, (true, false or null).
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* trueValue( char* ptr, json_t* property ) {
+    return primitiveValue( ptr, property, "true", JSON_BOOLEAN );
+}
+
+/** Parser a string to get a false value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type, (true, false or null).
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* falseValue( char* ptr, json_t* property ) {
+    return primitiveValue( ptr, property, "false", JSON_BOOLEAN );
+}
+
+/** Parser a string to get a null value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type, (true, false or null).
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* nullValue( char* ptr, json_t* property ) {
+    return primitiveValue( ptr, property, "null", JSON_NULL );
+}
+
+/** Analyze the exponential part of a real number.
+  * @param ptr Pointer to first character.
+  * @retval Pointer to first non numerical after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* expValue( char* ptr ) {
+    if ( *ptr == '-' || *ptr == '+' ) ++ptr;
+    if ( !isdigit( (int)(*ptr) ) ) return 0;
+    ptr = goNum( ++ptr );
+    return ptr;
+}
+
+/** Analyze the decimal part of a real number.
+  * @param ptr Pointer to first character.
+  * @retval Pointer to first non numerical after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* fraqValue( char* ptr ) {
+    if ( !isdigit( (int)(*ptr) ) ) return 0;
+    ptr = goNum( ++ptr );
+    if ( !ptr ) return 0;
+    return ptr;
+}
+
+/** Parser a string to get a numerical value.
+  * If the first character after the value is different of '}' or ']' is set to '\0'.
+  * @param ptr Pointer to first character.
+  * @param property Property handler to set the value and the type: JSON_REAL or JSON_INTEGER.
+  * @retval Pointer to first non white space after the string. If success.
+  * @retval Null pointer if any error occur. */
+static char* numValue( char* ptr, json_t* property ) {
+    if ( *ptr == '-' ) ++ptr;
+    if ( !isdigit( (int)(*ptr) ) ) return 0;
+    if ( *ptr != '0' ) {
+        ptr = goNum( ptr );
+        if ( !ptr ) return 0;
+    }
+    else if ( isdigit( (int)(*++ptr) ) ) return 0;
+    property->type = JSON_INTEGER;
+    if ( *ptr == '.' ) {
+        ptr = fraqValue( ++ptr );
+        if ( !ptr ) return 0;
+        property->type = JSON_REAL;
+    }
+    if ( *ptr == 'e' || *ptr == 'E' ) {
+        ptr = expValue( ++ptr );
+        if ( !ptr ) return 0;
+        property->type = JSON_REAL;
+    }
+    if ( !isEndOfPrimitive( *ptr ) ) return 0;
+    if ( JSON_INTEGER == property->type ) {
+        char const* value = property->u.value;
+        bool const negative = *value == '-';
+        static char const min[] = "-9223372036854775808";
+        static char const max[] = "9223372036854775807";
+        unsigned int const maxdigits = ( negative? sizeof min: sizeof max ) - 1;
+        unsigned int const len = ( unsigned int const ) ( ptr - value );
+        if ( len > maxdigits ) return 0;
+        if ( len == maxdigits ) {
+            char const tmp = *ptr;
+            *ptr = '\0';
+            char const* const threshold = negative ? min: max;
+            if ( 0 > strcmp( threshold, value ) ) return 0;
+            *ptr = tmp;
+        }
+    }
+    ptr = setToNull( ptr );
+    return ptr;
+}
+
+/** Add a property to a JSON object or array.
+  * @param obj The handler of the JSON object or array.
+  * @param property The handler of the property to be added. */
+static void add( json_t* obj, json_t* property ) {
+    property->sibling = 0;
+    if ( !obj->u.c.child ){
+	    obj->u.c.child = property;
+	    obj->u.c.last_child = property;
+    } else {
+	    obj->u.c.last_child->sibling = property;
+	    obj->u.c.last_child = property;
+    }
+}
+
+/** Parser a string to get a json object value.
+  * @param ptr Pointer to first character.
+  * @param obj The handler of the JSON root object or array.
+  * @param pool The handler of a json pool for creating json instances.
+  * @retval Pointer to first character after the value. If success.
+  * @retval Null pointer if any error occur. */
+static char* objValue( char* ptr, json_t* obj, jsonPool_t* pool ) {
+    obj->type    = *ptr == '{' ? JSON_OBJ : JSON_ARRAY;
+    obj->u.c.child = 0;
+    obj->sibling = 0;
+    ptr++;
+    for(;;) {
+        ptr = goBlank( ptr );
+        if ( !ptr ) return 0;
+        if ( *ptr == ',' ) {
+            ++ptr;
+            continue;
+        }
+        char const endchar = ( obj->type == JSON_OBJ )? '}': ']';
+        if ( *ptr == endchar ) {
+            *ptr = '\0';
+            json_t* parentObj = obj->sibling;
+            if ( !parentObj ) return ++ptr;
+            obj->sibling = 0;
+            obj = parentObj;
+            ++ptr;
+            continue;
+        }
+        json_t* property = pool->alloc( pool );
+        if ( !property ) return 0;
+        if( obj->type != JSON_ARRAY ) {
+            if ( *ptr != '\"' ) return 0;
+            ptr = propertyName( ptr, property );
+            if ( !ptr ) return 0;
+        }
+        else property->name = 0;
+        add( obj, property );
+        property->u.value = ptr;
+        switch( *ptr ) {
+            case '{':
+                property->type    = JSON_OBJ;
+                property->u.c.child = 0;
+                property->sibling = obj;
+                obj = property;
+                ++ptr;
+                break;
+            case '[':
+                property->type    = JSON_ARRAY;
+                property->u.c.child = 0;
+                property->sibling = obj;
+                obj = property;
+                ++ptr;
+                break;
+            case '\"': ptr = textValue( ptr, property );  break;
+            case 't':  ptr = trueValue( ptr, property );  break;
+            case 'f':  ptr = falseValue( ptr, property ); break;
+            case 'n':  ptr = nullValue( ptr, property );  break;
+            default:   ptr = numValue( ptr, property );   break;
+        }
+        if ( !ptr ) return 0;
+    }
+}
+
+/** Initialize a json pool.
+  * @param pool The handler of the pool.
+  * @return a instance of a json. */
+static json_t* poolInit( jsonPool_t* pool ) {
+    jsonStaticPool_t *spool = json_containerOf( pool, jsonStaticPool_t, pool );
+    spool->nextFree = 1;
+    return spool->mem;
+}
+
+/** Create an instance of a json from a pool.
+  * @param pool The handler of the pool.
+  * @retval The handler of the new instance if success.
+  * @retval Null pointer if the pool was empty. */
+static json_t* poolAlloc( jsonPool_t* pool ) {
+    jsonStaticPool_t *spool = json_containerOf( pool, jsonStaticPool_t, pool );
+    if ( spool->nextFree >= spool->qty ) return 0;
+    return spool->mem + spool->nextFree++;
+}
+
+/** Checks whether an character belongs to set.
+  * @param ch Character value to be checked.
+  * @param set Set of characters. It is just a null-terminated string.
+  * @return true or false there is membership or not. */
+static bool isOneOfThem( char ch, char const* set ) {
+    while( *set != '\0' )
+        if ( ch == *set++ )
+            return true;
+    return false;
+}
+
+/** Increases a pointer while it points to a character that belongs to a set.
+  * @param str The initial pointer value.
+  * @param set Set of characters. It is just a null-terminated string.
+  * @return The final pointer value or null pointer if the null character was found. */
+static char* goWhile( char* str, char const* set ) {
+    for(; *str != '\0'; ++str ) {
+        if ( !isOneOfThem( *str, set ) )
+            return str;
+    }
+    return 0;
+}
+
+/** Set of characters that defines a blank. */
+static char const* const blank = " \n\r\t\f";
+
+/** Increases a pointer while it points to a white space character.
+  * @param str The initial pointer value.
+  * @return The final pointer value or null pointer if the null character was found. */
+static char* goBlank( char* str ) {
+    return goWhile( str, blank );
+}
+
+/** Increases a pointer while it points to a decimal digit character.
+  * @param str The initial pointer value.
+  * @return The final pointer value or null pointer if the null character was found. */
+static char* goNum( char* str ) {
+    for( ; *str != '\0'; ++str ) {
+        if ( !isdigit( (int)(*str) ) )
+            return str;
+    }
+    return 0;
+}
+
+/** Set of characters that defines the end of an array or a JSON object. */
+static char const* const endofblock = "}]";
+
+/** Set a char to '\0' and increase its pointer if the char is different to '}' or ']'.
+  * @param ch Pointer to character.
+  * @return  Final value pointer. */
+static char* setToNull( char* ch ) {
+    if ( !isOneOfThem( *ch, endofblock ) ) *ch++ = '\0';
+    return ch;
+}
+
+/** Indicate if a character is the end of a primitive value. */
+static bool isEndOfPrimitive( char ch ) {
+    return ch == ',' || isOneOfThem( ch, blank ) || isOneOfThem( ch, endofblock );
+}

+ 176 - 0
include_bakbak/tiny_json.h

@@ -0,0 +1,176 @@
+
+/*
+
+<https://github.com/rafagafe/tiny-json>
+     
+  Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+  SPDX-License-Identifier: MIT
+  Copyright (c) 2016-2018 Rafa Garcia <rafagarcia77@gmail.com>.
+
+  Permission is hereby  granted, free of charge, to any  person obtaining a copy
+  of this software and associated  documentation files (the "Software"), to deal
+  in the Software  without restriction, including without  limitation the rights
+  to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+  copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in all
+  copies or substantial portions of the Software.
+
+  THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+  IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+  FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+  AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+  LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+    
+*/
+
+#ifndef _TINY_JSON_H_
+#define	_TINY_JSON_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define json_containerOf( ptr, type, member ) \
+    ((type*)( (char*)ptr - offsetof( type, member ) ))
+
+/** @defgroup tinyJson Tiny JSON parser.
+  * @{ */
+
+/** Enumeration of codes of supported JSON properties types. */
+typedef enum {
+    JSON_OBJ, JSON_ARRAY, JSON_TEXT, JSON_BOOLEAN,
+    JSON_INTEGER, JSON_REAL, JSON_NULL
+} jsonType_t;
+
+/** Structure to handle JSON properties. */
+typedef struct json_s {
+    struct json_s* sibling;
+    char const* name;
+    union {
+        char const* value;
+        struct {
+            struct json_s* child;
+            struct json_s* last_child;
+        } c;
+    } u;
+    jsonType_t type;
+} json_t;
+
+/** Parse a string to get a json.
+  * @param str String pointer with a JSON object. It will be modified.
+  * @param mem Array of json properties to allocate.
+  * @param qty Number of elements of mem.
+  * @retval Null pointer if any was wrong in the parse process.
+  * @retval If the parser process was successfully a valid handler of a json.
+  *         This property is always unnamed and its type is JSON_OBJ. */
+json_t const* json_create( char* str, json_t mem[], unsigned int qty );
+
+/** Get the name of a json property.
+  * @param json A valid handler of a json property.
+  * @retval Pointer to null-terminated if property has name.
+  * @retval Null pointer if the property is unnamed. */
+static inline char const* json_getName( json_t const* json ) {
+    return json->name;
+}
+
+/** Get the value of a json property.
+  * The type of property cannot be JSON_OBJ or JSON_ARRAY.
+  * @param property A valid handler of a json property.
+  * @return Pointer to null-terminated string with the value. */
+static inline char const* json_getValue( json_t const* property ) {
+    return property->u.value;
+}
+
+/** Get the type of a json property.
+  * @param json A valid handler of a json property.
+  * @return The code of type.*/
+static inline jsonType_t json_getType( json_t const* json ) {
+    return json->type;
+}
+
+/** Get the next sibling of a JSON property that is within a JSON object or array.
+  * @param json A valid handler of a json property.
+  * @retval The handler of the next sibling if found.
+  * @retval Null pointer if the json property is the last one. */
+static inline json_t const* json_getSibling( json_t const* json ) {
+    return json->sibling;
+}
+
+/** Search a property by its name in a JSON object.
+  * @param obj A valid handler of a json object. Its type must be JSON_OBJ.
+  * @param property The name of property to get.
+  * @retval The handler of the json property if found.
+  * @retval Null pointer if not found. */
+json_t const* json_getProperty( json_t const* obj, char const* property );
+
+
+/** Search a property by its name in a JSON object and return its value.
+  * @param obj A valid handler of a json object. Its type must be JSON_OBJ.
+  * @param property The name of property to get.
+  * @retval If found a pointer to null-terminated string with the value.
+  * @retval Null pointer if not found or it is an array or an object. */
+char const* json_getPropertyValue( json_t const* obj, char const* property );
+
+/** Get the first property of a JSON object or array.
+  * @param json A valid handler of a json property.
+  *             Its type must be JSON_OBJ or JSON_ARRAY.
+  * @retval The handler of the first property if there is.
+  * @retval Null pointer if the json object has not properties. */
+static inline json_t const* json_getChild( json_t const* json ) {
+    return json->u.c.child;
+}
+
+/** Get the value of a json boolean property.
+  * @param property A valid handler of a json object. Its type must be JSON_BOOLEAN.
+  * @return The value stdbool. */
+static inline bool json_getBoolean( json_t const* property ) {
+    return *property->u.value == 't';
+}
+
+/** Get the value of a json integer property.
+  * @param property A valid handler of a json object. Its type must be JSON_INTEGER.
+  * @return The value stdint. */
+static inline int64_t json_getInteger( json_t const* property ) {
+  return strtoll( property->u.value,(char**)NULL, 10);
+}
+
+/** Get the value of a json real property.
+  * @param property A valid handler of a json object. Its type must be JSON_REAL.
+  * @return The value. */
+static inline double json_getReal( json_t const* property ) {
+  return strtod( property->u.value,(char**)NULL );
+}
+
+
+
+/** Structure to handle a heap of JSON properties. */
+typedef struct jsonPool_s jsonPool_t;
+struct jsonPool_s {
+    json_t* (*init)( jsonPool_t* pool );
+    json_t* (*alloc)( jsonPool_t* pool );
+};
+
+/** Parse a string to get a json.
+  * @param str String pointer with a JSON object. It will be modified.
+  * @param pool Custom json pool pointer.
+  * @retval Null pointer if any was wrong in the parse process.
+  * @retval If the parser process was successfully a valid handler of a json.
+  *         This property is always unnamed and its type is JSON_OBJ. */
+json_t const* json_createWithPool( char* str, jsonPool_t* pool );
+
+/** @ } */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* _TINY_JSON_H_ */

+ 62 - 0
include_bakbak/yolo.h

@@ -0,0 +1,62 @@
+#ifndef _YOLOV_H_
+#define _YOLOV_H_
+#include "eznn_api.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+const char *yolov_labels_name[1] = {
+	"face"
+};
+
+typedef enum ezax_yolo_model {
+	EZAX_MODEL_YOLOV3,
+	EZAX_MODEL_YOLOV5,
+} ezax_yolo_model_t;
+
+typedef struct eazx_pets_det_cfg {
+	char *model_rootpath;
+	int   model_type;
+	int   width;
+	int   height;
+} ezax_pets_det_cfg_t;
+
+typedef struct ax_nna_tensor
+{
+    /* vir and phy addr */
+    void *pVir; unsigned pPhy;
+    /* data size */
+    int  nDatasz;
+    /* tensor width, height, channel, batch number, fraction point */
+    int  w; int h; int c; int n; int fl;
+    /* 2: int8, 4 int16 */
+    int dtype;
+    /* tensor name */
+    char nTensorName[32];
+    /* reserved */
+    int  rzv;
+}ax_nna_tensor_t;
+
+typedef struct ax_nna_tensors
+{
+    /* tensor pointer */
+    ax_nna_tensor_t *nTensor;
+    /* tensor number */
+    int  nTensorNum;
+}ax_nna_tensors_t;
+
+typedef enum ezax_yolo_cmd {
+	EZAX_YOLO_RESET_AXFREQ,
+	EZAX_YOLO_GET_AXFREQ,
+} ezax_yolo_cmd_t;
+
+void *nna_pets_det_open(ezax_pets_det_cfg_t *cfg);
+int  nna_pets_det_cmd(void *hdl, ezax_yolo_cmd_t cmd,unsigned int args);
+int nna_pets_det_process(void *hdl,ezax_img_t *pImg,ezax_boxes_t *yolo_det_out,float conf_thresh,float iou_thresh);
+int  nna_pets_det_close(void *hdl);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif

二进制
libs/liblog.so


+ 45 - 0
main.cpp

@@ -0,0 +1,45 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <iostream>
+#include <stdio.h>
+#include <string.h>
+#include <vector>
+#include "ansjer_ai_cfg.h"
+
+int main()
+{
+	char *filename = (char *)"yolo_config.json";
+	Asj_Ai_Cfg_t *ai_config; 
+	ai_config = (Asj_Ai_Cfg_t *)malloc(sizeof(Asj_Ai_Cfg_t));
+	memset(ai_config, 0, sizeof(Asj_Ai_Cfg_t));
+	read_Asj_Ai_Json(ai_config,filename);
+	// std::cout << "ezbStr:" << ai_config->property.ezbStr << std::endl;
+
+	// std::cout << "binStr:" << ai_config->property.binStr << std::endl;
+	std::cout << "---------anchors_start------" << std::endl;
+	for (int i = 0; i < 18; i++)
+		// std::cout << ai_config->property.anchors[i] << std::endl;
+	std::cout << "---------anchors_end------" << std::endl;
+
+	std::cout << "---------label_start------" << std::endl;
+	for (int i = 0; i <ai_config->property.label.size() ; i++)
+		std::cout << ai_config->property.label[i] << std::endl;
+	std::cout << "---------label_end------" << std::endl;
+
+	std::cout << "---------yolo_outputs_name------" << std::endl;
+	for (int i = 0; i <ai_config->property.yolo_outputs_name.size() ; i++)
+		std::cout << ai_config->property.yolo_outputs_name[i] << std::endl;
+	std::cout << "---------yolo_outputs_name_end------" << std::endl;
+
+
+	std::cout << "need_nu_freq:" << ai_config->property.need_nu_freq << std::endl;
+	std::cout << "need_vu_freq:" << ai_config->property.need_vu_freq << std::endl;
+	std::cout << "freq_nu:" << ai_config->property.freq_nu << std::endl;
+	std::cout << "freq_vu:" << ai_config->property.freq_vu << std::endl;
+	
+	std::cout << "iou_thresh:" << ai_config->class_attrs_all.iou_thresh << std::endl;
+	std::cout << "conf_thresh:" << ai_config->class_attrs_all.conf_thresh << std::endl;
+
+	return 0;
+}
+

文件差异内容过多而无法显示
+ 0 - 0
model_and_data/images.yuv


文件差异内容过多而无法显示
+ 0 - 0
model_and_data/images_media_post.yuv


二进制
model_and_data/model_crowdhuman.bin


二进制
model_and_data/model_crowdhuman.ezb


二进制
model_and_data/model_fire.bin


二进制
model_and_data/model_fire.ezb


二进制
model_and_data/model_pet.bin


二进制
model_and_data/model_pet.ezb


+ 18 - 0
model_and_data/yolo_config.json

@@ -0,0 +1,18 @@
+{
+	"property": {
+		"model_type": "yolov5",
+		"ezb_model_path": "/share/model.ezb",
+		"ezb_bin_path": "/share/model.bin",
+		"yolo_anchor": [],
+		"label": ["fire"],
+		"output_blob_names": ["/model.22/Concat", "/model.22/Concat_1", "/model.22/Concat_2"],
+		"need_nu_freq": true,
+		"freq_nu": 700,
+		"need_vu_freq": true,
+		"freq_vu": 700
+	},
+	"class_attrs_all": {
+		"pre_cluster_threshold": 0.25,
+		"nms_iou_threshold": 0.45
+	}
+}

+ 17 - 0
model_and_data/yolo_config_crowdhuman.json

@@ -0,0 +1,17 @@
+{
+	"property": {
+		"ezb_model_path": "/platform/ax/model/pet.ezb",
+		"ezb_bin_path": "/platform/ax/model/pet.bin",
+		"yolo_anchor": [10,13,16,30,33,23,30,61,62,45,59,119,116,90,156,198,373,326],
+		"label": ["head", "person"],
+		"output_blob_names": ["/model.24/m.0/Conv","/model.24/m.1/Conv","/model.24/m.2/Conv"],
+		"need_nu_freq": true,
+		"freq_nu": 700,
+		"need_vu_freq": true,
+		"freq_vu": 700
+	},
+	"class_attrs_all": {
+		"pre_cluster_threshold": 0.25,
+		"nms_iou_threshold": 0.25
+	}
+}

二进制
model_and_data/yolov5.bin


二进制
model_and_data/yolov5.ezb


+ 18 - 0
model_and_data/yolov5_config_fire.json

@@ -0,0 +1,18 @@
+{
+	"property": {
+		"model_type": "yolov5",
+		"ezb_model_path": "/platform/ax/model/custom_yolov5_fire.ezb",
+		"ezb_bin_path": "/platform/ax/model/custom_yolov5_fire.bin",
+		"yolo_anchor": [10,13,16,30,33,23,30,61,62,45,59,119,116,90,156,198,373,326],
+		"label": ["fire"],
+		"output_blob_names": ["/model.24/m.0/Conv","/model.24/m.1/Conv","/model.24/m.2/Conv"],
+		"need_nu_freq": true,
+		"freq_nu": 700,
+		"need_vu_freq": true,
+		"freq_vu": 700
+	},
+	"class_attrs_all": {
+		"pre_cluster_threshold": 0.5,
+		"nms_iou_threshold": 0.6
+	}
+}

+ 18 - 0
model_and_data/yolov5_config_pet.json

@@ -0,0 +1,18 @@
+{
+	"property": {
+		"model_type": "yolov5",
+		"ezb_model_path": "/platform/ax/model/custom_yolov5_pet.ezb",
+		"ezb_bin_path": "/platform/ax/model/custom_yolov5_pet.bin",
+		"yolo_anchor": [10,13,16,30,33,23,30,61,62,45,59,119,116,90,156,198,373,326],
+		"label": ["dog", "cat"],
+		"output_blob_names": ["/model.24/m.0/Conv","/model.24/m.1/Conv","/model.24/m.2/Conv"],
+		"need_nu_freq": true,
+		"freq_nu": 700,
+		"need_vu_freq": true,
+		"freq_vu": 700
+	},
+	"class_attrs_all": {
+		"pre_cluster_threshold": 0.5,
+		"nms_iou_threshold": 0.6
+	}
+}

+ 18 - 0
model_and_data/yolov8_config_fire.json

@@ -0,0 +1,18 @@
+{
+	"property": {
+		"model_type": "yolov8",
+		"ezb_model_path": "/platform/ax/model/custom_yolov8_fire.ezb",
+		"ezb_bin_path": "/platform/ax/model/custom_yolov8_fire.bin",
+		"yolo_anchor": [],
+		"label": ["fire"],
+		"output_blob_names": ["/model.22/Concat", "/model.22/Concat_1", "/model.22/Concat_2"],
+		"need_nu_freq": true,
+		"freq_nu": 700,
+		"need_vu_freq": true,
+		"freq_vu": 700
+	},
+	"class_attrs_all": {
+		"pre_cluster_threshold": 0.5,
+		"nms_iou_threshold": 0.6
+	}
+}

二进制
out/images.yuv


二进制
out/libs/liblog.so


二进制
out/libs/libnn_yolo.so


二进制
out/model.bin


二进制
out/model.ezb


二进制
out/nn_yolo_test


+ 10 - 0
out/run_on_board.sh

@@ -0,0 +1,10 @@
+# chmod +x nn_yolo_test
+
+# export LD_PRELOAD=""
+# export LD_LIBRARY_PATH="/data/out/libs"
+# export LD_LIBRARY_PATH="/platform/lib:/share/libs"
+# export LD_LIBRARY_PATH="/platform/ax/lib:/platform/lib:/share/libs"
+
+chmod +x nn_yolo_test
+export LD_LIBRARY_PATH="/platform/ax/lib:/platform/lib:/share/libs"
+./nn_yolo_test

+ 18 - 0
out/yolo_config.json

@@ -0,0 +1,18 @@
+{
+	"property": {
+		"model_type": "yolov5",
+		"ezb_model_path": "/share/model.ezb",
+		"ezb_bin_path": "/share/model.bin",
+		"yolo_anchor": [],
+		"label": ["fire"],
+		"output_blob_names": ["/model.22/Concat", "/model.22/Concat_1", "/model.22/Concat_2"],
+		"need_nu_freq": true,
+		"freq_nu": 700,
+		"need_vu_freq": true,
+		"freq_vu": 700
+	},
+	"class_attrs_all": {
+		"pre_cluster_threshold": 0.25,
+		"nms_iou_threshold": 0.45
+	}
+}

+ 10 - 0
run_on_board.sh

@@ -0,0 +1,10 @@
+# chmod +x nn_yolo_test
+
+# export LD_PRELOAD=""
+# export LD_LIBRARY_PATH="/data/out/libs"
+# export LD_LIBRARY_PATH="/platform/lib:/share/libs"
+# export LD_LIBRARY_PATH="/platform/ax/lib:/platform/lib:/share/libs"
+
+chmod +x nn_yolo_test
+export LD_LIBRARY_PATH="/platform/ax/lib:/platform/lib:/share/libs"
+./nn_yolo_test

+ 31 - 0
yolo/Makefile

@@ -0,0 +1,31 @@
+SDK_ROOT := $(PWD)/../../../
+CC := $(SDK_ROOT)/toolchain/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-c++
+# CC := /home/ubuntu/sv82x-v1.1_bak1/toolchain/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
+CXX := $(SDK_ROOT)/toolchain/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
+AR := $(SDK_ROOT)/toolchain/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf--ar
+STRIP := $(SDK_ROOT)/toolchain/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf--strip
+AX_LIBS :=$(SDK_ROOT)/frameworks/nn/lib/n7v3/armhf
+SDK_LIBS := $(SDK_ROOT)/system/mdp/build/platform/lib
+
+PROG := libnn_yolo.so
+
+SOURCES := ./yolo.cpp \
+			./../include/tiny_json.c \
+			./ansjer_ai_cfg.c
+
+INCLUDE_PATH += -I ./../include/
+INCLUDE_PATH += -I ./../include/libnn/
+INCLUDE_PATH += -I ./../include/VX
+INCLUDE_PATH += -I ./../include/VX_EXT/
+CFLAGS += $(INCLUDE_PATH)
+
+LDFLAGS += -L $(AX_LIBS) -lnn_base
+LDFLAGS += -lpthread -ldl
+
+CFLAGS += -O2
+
+all: $(PROG)
+$(PROG): $(SOURCES)
+	$(CC) $(SOURCES) -shared -fPIC -o $@ $(CFLAGS) $(LDFLAGS)
+clean:
+	rm -rf *.so

+ 78 - 0
yolo/ansjer_ai_cfg.c

@@ -0,0 +1,78 @@
+#include "ansjer_ai_cfg.h"
+#include <iostream>
+#include <string.h>
+
+char* load_file(char const* path)
+{
+    char* buffer = 0;
+    long length;
+    FILE * f = fopen (path, "rb"); //was "rb"
+
+    if (f)
+    {
+      fseek (f, 0, SEEK_END);
+      length = ftell (f);
+      fseek (f, 0, SEEK_SET);
+      buffer = (char*)malloc ((length+1)*sizeof(char));
+      if (buffer)
+      {
+        fread (buffer, sizeof(char), length, f);
+      }
+      fclose (f);
+    }
+    buffer[length] = '\0';
+    // for (int i = 0; i < length; i++) {
+    //     printf("buffer[%d] == %c\n", i, buffer[i]);
+    // }
+    //printf("buffer = %s\n", buffer);
+
+    return buffer;
+}
+
+
+int read_Asj_Ai_Json (void *hdl, char *filename){
+	char *json_file_str = load_file(filename);
+	printf("%s",json_file_str);
+	Asj_Ai_Cfg_t *ai_config = (Asj_Ai_Cfg_t *)hdl;
+	
+	json_t mem[64];
+	json_t const* json = json_create(json_file_str, mem, sizeof mem / sizeof *mem );
+
+    json_t const* property = json_getProperty(json, "property");
+	json_t const* model_type = json_getProperty(property, "model_type");
+	ai_config->property.model_type = json_getValue(model_type);
+	json_t const* ezb_model_path = json_getProperty(property, "ezb_model_path");
+	strcpy(ai_config->property.ezbStr, json_getValue(ezb_model_path ));
+	json_t const* ezb_bin_path = json_getProperty(property, "ezb_bin_path");
+	strcpy(ai_config->property.binStr, json_getValue(ezb_bin_path ));
+	json_t const* yolo_anchor = json_getProperty(property, "yolo_anchor");
+	int index = 0;
+	for(json_t const* i = json_getChild(yolo_anchor); i != 0; i = json_getSibling(i)) {
+		ai_config->property.anchors[index] = json_getInteger(i);
+		index++;
+    }
+	index = 0;
+	json_t const* label = json_getProperty(property, "label" );
+	for(json_t const* i = json_getChild(label); i != 0; i = json_getSibling(i)) {
+		ai_config->property.label.push_back(json_getValue(i));
+		index++;
+    }
+	index = 0;
+
+	json_t const* output_blob_names = json_getProperty(property, "output_blob_names");
+	for(json_t const* i = json_getChild(output_blob_names); i != 0; i = json_getSibling(i)) {
+		ai_config->property.yolo_outputs_name.push_back( json_getValue(i));
+		index++;
+    }
+
+	json_t const* need_nu_freq = json_getProperty(property, "need_nu_freq" );
+
+	ai_config->property.need_nu_freq = json_getBoolean(json_getProperty(property, "need_nu_freq"));
+    ai_config->property.freq_nu = json_getInteger(json_getProperty(property,"freq_nu"));
+	ai_config->property.need_vu_freq = json_getBoolean(json_getProperty(property,"need_vu_freq"));
+    ai_config->property.freq_vu = json_getInteger(json_getProperty(property,"freq_vu"));
+	json_t const* class_attrs_all = json_getProperty( json, "class_attrs_all");
+	ai_config->class_attrs_all.conf_thresh = json_getReal(json_getProperty(class_attrs_all,"pre_cluster_threshold"));
+	ai_config->class_attrs_all.iou_thresh = json_getReal(json_getProperty(class_attrs_all,"nms_iou_threshold"));
+	return 1;
+}

二进制
yolo/libnn_yolo.so


+ 627 - 0
yolo/yolo.cpp

@@ -0,0 +1,627 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <VX/vx.h>
+#include <vx_ext_amd.h>
+#include <net_api.h>
+#include <math.h>
+#include <memory.h>
+#include <algorithm>
+#include <vx_log.h>
+#include <unistd.h>
+#include "yolo.h"
+#include <ax_type.h>
+#include "ansjer_ai_cfg.h"
+
+#ifndef CLIPRETINA
+#define CLIPRETINA(v,mn,mx)				\
+{							\
+	if ((v)<(mn))		{(v)=(mn);}	\
+	else if((v)>(mx))	{(v)=(mx);}	\
+}
+#endif
+
+#define JSONPATH "/platform/ax/model/"
+
+typedef struct {
+	vx_size dst_handle;
+	vx_context context;
+	vx_context handle_context;
+	vx_graph graph;
+    // net_work_width
+	int net_w;
+    // net_work_hight
+	int net_h;
+    // input_image_width
+	int src_w;
+    // input_image_hight
+	int src_h;
+    // wh_scale
+	float scale_info;
+
+	unsigned int strides[3];
+	int nBlobSz;
+	ax_nna_tensors_t pOutTensor;
+
+	std::string model_type;
+	unsigned int anchors_g[18];
+	std::vector<std::string> yolo_outputs_name_g;
+	std::vector<std::string> label;
+	bool need_nu_freq;
+    int freq_nu;
+    bool need_vu_freq;
+    int freq_vu;
+
+	float conf_thresh;
+    float iou_thresh;
+} nna_yolo_private_t;
+
+struct Box {
+	float xyxy[4] = { 0, 0, 0, 0 };
+	float object_score = 0;
+	size_t index = 0;
+	float score = 0;
+	float area = 0;
+};
+
+static float sigmoid(float x)
+{
+	return 1.0 / (1.0 + exp(-x));
+}
+
+static void dfl_process(const std::vector<float> &dfl, std::vector<float> &dst, int reg_max=16)
+{
+	std::vector<float> temp;
+	float max_value, denominator, sum_value;
+	for(int i = 0; i < int(dfl.size() / reg_max); ++i){
+		max_value = *std::max_element(dfl.begin() + int(i * reg_max), dfl.begin() + int((i + 1) * reg_max));
+		denominator = 0;
+    	sum_value = 0;
+
+		for(int j = int(i * reg_max); j < int((i + 1) * reg_max);++j){
+			temp.push_back(std::exp(dfl[j] - max_value));
+			denominator += temp[j];
+		}
+		for(int j = int(i * reg_max); j < int((i + 1) * reg_max);++j){
+			temp[j] /= denominator;
+			sum_value += temp[j] * (j - int(i * reg_max));
+		}
+		dst.push_back(sum_value);
+	}
+}
+
+void RefineFileName(int len, char * fname)
+{
+	for (int n = 0; n < len; n++) {
+		if (fname[n] == '/' || 
+			fname[n] == '(' || 
+			fname[n] == ')' ||
+			fname[n] == ',' ||
+			fname[n] == ' ' ||
+			fname[n] == '[' ||
+			fname[n] == ']' ||
+			fname[n] == ':') 
+		{
+			fname[n] = '_';
+		}
+	}
+}
+
+int DumpBlobsInfo(std::vector<std::string> & blobs_name, std::vector<vx_tensor> & blobs_tensor)
+{
+	for (int i = 0; i < blobs_name.size(); i++) {
+		vx_size dims[4];
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_DIMS, dims, sizeof(dims)));		
+		vx_enum data_type;
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_DATA_TYPE, &data_type, sizeof(data_type)));
+		vx_size fixed_pos;
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_FIXED_POINT_POSITION, &fixed_pos, sizeof(fixed_pos)));
+		vx_size data_size;
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_MEMORY_SIZE, &data_size, sizeof(data_size)));
+		vx_size data_handle;
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_MEMORY_HANDLE, &data_handle, sizeof(data_handle)));		
+		vx_size data_virt_addr;
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_MEMORY_VIRT_ADDR, &data_virt_addr, sizeof(data_virt_addr)));
+		vx_size data_phys_addr;
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_MEMORY_PHYS_ADDR, &data_phys_addr, sizeof(data_phys_addr)));
+		
+		VX_LOG("name: %s\n", blobs_name.at(i).c_str());
+		VX_LOG("\t(w, h, c, b): (%d, %d, %d, %d)\n", dims[0], dims[1], dims[2], dims[3]);
+		VX_LOG("\tdata type: %d\n", data_type);
+		VX_LOG("\tfixed position: %d\n", fixed_pos);
+		VX_LOG("\tdata size: %d\n", data_size);
+		VX_LOG("\tdata handle: 0x%x\n", data_handle);
+		VX_LOG("\tdata virt addr: 0x%x\n", data_virt_addr);
+		VX_LOG("\tdata phys addr: 0x%x\n", data_phys_addr);
+	}
+	return 0;
+}
+
+int DumpBlobsData(std::vector<std::string> & blobs_name, std::vector<vx_tensor> & blobs_tensor)
+{
+	for (int i = 0; i < blobs_name.size(); i++) {
+		vx_size dims[4];
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_DIMS, dims, sizeof(dims)));
+		vx_size data_size;
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_MEMORY_SIZE, &data_size, sizeof(data_size)));
+		vx_int8 * data;
+		ERROR_CHECK_STATUS(vxQueryTensor(blobs_tensor.at(i), VX_TENSOR_MEMORY_VIRT_ADDR, &data, sizeof(data)));	
+		VX_LOG("name: %s, dims: (%d, %d, %d, %d), data size: %d\n", blobs_name.at(i).c_str(), dims[0], dims[1], dims[2], dims[3], data_size);
+		char out_file[512];
+		sprintf(out_file, "/share/res_hw/%s.bin", blobs_name.at(i).c_str());
+		RefineFileName(512, out_file);
+		FILE * fin = fopen(out_file, "wb");
+		fwrite(data, 1, data_size, fin);
+		fclose(fin);
+	}
+	return 0;
+}
+
+static bool yolov5_layer(std::vector<Box>& proposals,
+	const signed char* output_ptr,
+	const size_t output_size[4],
+	const unsigned int& image_size,
+	const unsigned int& stride,
+	const unsigned int& fl,
+	const unsigned int& data_type,
+	const unsigned int* anchor,
+	const unsigned int& class_num,
+	const float& confidence_threshold)
+{
+	int H_algin = 0;
+	if (data_type == 2) H_algin = (output_size[1] + 3) / 4 * 4;
+	else H_algin = (output_size[1] + 1) / 2 * 2;
+
+	for (size_t a = 0; a < 3; ++a) { // anchor groups = 3
+		for (size_t w = 0; w < output_size[0]; ++w) {
+			for (size_t h = 0; h < output_size[1]; ++h) {
+				Box box;
+				size_t max_index = 0;
+				float max_score = -1;
+				for (size_t c = 0; c < 4 + 1 + class_num; ++c) {
+					size_t ci = a * (4 + 1 + class_num) + c;
+					size_t index = ci / 16 * output_size[0] * H_algin * 16 + w * H_algin * 16 + h * 16 + (ci % 16);
+
+					// scale and sigmoid
+					float data = sigmoid(output_ptr[index] * 1.0 / pow(2, fl));
+					if (c == 0) {
+						data = (data * 2 - 0.5f + w) * static_cast<float>(stride);
+						box.xyxy[c] = data;
+					} else if (c == 1) {
+						data = (data * 2 - 0.5f + h) * static_cast<float>(stride);
+						box.xyxy[c] = data;
+					} else if (c == 2 || c == 3) {
+						data = powf((data * 2), 2) * anchor[a * 2 + c - 2];
+						box.xyxy[c] = data;
+					} else if (c == 4) {
+						box.object_score = data;
+					} else {
+						if (data > max_score) {
+							max_index = c - 5;
+							max_score = data;
+						}
+					}
+				}
+				box.score = max_score * box.object_score;
+				box.index = max_index;
+				if (box.object_score > confidence_threshold && box.score > confidence_threshold) {
+					// xywh -> xyxy
+					float x = box.xyxy[0], y = box.xyxy[1], w = box.xyxy[2], h = box.xyxy[3];
+					box.xyxy[0] = x - w / 2;
+					box.xyxy[1] = y - h / 2;
+					box.xyxy[2] = x + w / 2;
+					box.xyxy[3] = y + h / 2;
+					box.area = (box.xyxy[2] - box.xyxy[0] + 1) * (box.xyxy[3] - box.xyxy[1] + 1);
+					proposals.push_back(box);
+					// VX_LOG("%s box %f %f %f %f %f %d\n", __FUNCTION__, box.xyxy[0], box.xyxy[1], box.xyxy[2], box.xyxy[3], box.score, box.index);
+				}
+			}
+		}
+	}
+
+	return VX_SUCCESS;
+}
+
+static bool yolov8_layer(std::vector<Box>& proposals,
+	const signed char* output_ptr,
+	const size_t output_size[4],
+	const unsigned int& image_size,
+	const unsigned int& stride,
+	const unsigned int& fl,
+	const unsigned int& data_type,
+	const unsigned int& class_num,
+	const float& confidence_threshold)
+{
+	int reg_max = 16;
+	float grid_cell_offset = 0.5f;
+	int H_algin = 0;
+	if (data_type == 2) H_algin = (output_size[1] + 3) / 4 * 4;
+	else H_algin = (output_size[1] + 1) / 2 * 2;
+
+	for (size_t w = 0; w < output_size[0]; ++w) {
+		for (size_t h = 0; h < output_size[1]; ++h) {	
+			Box box;
+			size_t max_index = 0;
+			float max_score = -1;
+			std::vector<float> dfl, ltrb;
+			for (size_t c = 0; c < 4 * reg_max + class_num; ++c) {
+				size_t index = c / 16 * output_size[0] * H_algin * 16 + w * H_algin * 16 + h * 16 + c % 16;
+
+				float data = output_ptr[index] * 1.0 / pow(2, fl);
+				if (c < 4 * reg_max) {
+					dfl.push_back(data);
+					if (c == (4 * reg_max - 1)){
+						dfl_process(dfl, ltrb, reg_max);
+						box.xyxy[0] = (w + grid_cell_offset - ltrb[0]) * stride;
+						box.xyxy[1] = (h + grid_cell_offset - ltrb[1]) * stride;
+						box.xyxy[2] = (w + grid_cell_offset + ltrb[2]) * stride;
+						box.xyxy[3] = (h + grid_cell_offset + ltrb[3]) * stride;
+					}
+					
+				} else {
+					if (data > max_score) {
+						max_index = c - 4 * reg_max;
+						max_score = data;
+					}
+				}
+			}
+			box.score = max_score;
+			box.index = max_index;
+			if (box.score > confidence_threshold) {
+				box.area = (box.xyxy[2] - box.xyxy[0] + 1) * (box.xyxy[3] - box.xyxy[1] + 1);
+				proposals.push_back(box);
+				// VX_LOG("%s box %f %f %f %f %f %d\n", __FUNCTION__, box.xyxy[0], box.xyxy[1], box.xyxy[2], box.xyxy[3], box.score, box.index);
+			}
+		}
+	}	
+	return VX_SUCCESS;
+}
+
+static bool yolov_box_cmp(const Box& a, const Box& b)
+{
+	return a.score > b.score;
+}
+
+static bool yolo_nms(std::vector<Box>& boxes, const float& nms_threshold)
+{
+	std::sort(boxes.begin(), boxes.end(), yolov_box_cmp);
+
+	size_t current_index = 0;
+	while (current_index < boxes.size()) {
+		Box current_box = boxes[current_index];
+		size_t running_index = current_index + 1;
+		while (running_index < boxes.size()) {
+			Box running_box = boxes[running_index];
+
+			float xx1 = std::max(current_box.xyxy[0], running_box.xyxy[0]);
+			float yy1 = std::max(current_box.xyxy[1], running_box.xyxy[1]);
+			float xx2 = std::min(current_box.xyxy[2], running_box.xyxy[2]);
+			float yy2 = std::min(current_box.xyxy[3], running_box.xyxy[3]);
+			float w = std::max(0.0f, xx2 - xx1 + 1.0f);
+			float h = std::max(0.0f, yy2 - yy1 + 1.0f);
+
+			float inter_area = w * h;
+			float union_area = current_box.area + running_box.area - inter_area;
+			float overlap = inter_area / union_area;
+			if (overlap > nms_threshold) {
+				boxes.erase(boxes.begin() + running_index);
+			} else {
+				++running_index;
+			}
+		}
+		++current_index;
+	}
+
+	return VX_SUCCESS;
+}
+
+void *nna_custom_det_open(ezax_custom_det_cfg_t *cfg)
+{
+	// char *filename = (char *)"/data/yolo_config.json";
+	// char *filename = (char *)"/platform/ax/model/yolo_config.json";
+	// char *filename = (char *)"/share/yolo_config.json";
+
+	// VX_LOG("%s Line:%d %s\n", __FUNCTION__, __LINE__, cfg->model_rootpath);
+	char *filename = (char*)malloc(strlen(JSONPATH) + strlen(cfg->model_rootpath) + 1);
+	strcpy(filename, JSONPATH);
+    strcat(filename, cfg->model_rootpath);
+	VX_LOG("%s Line:%d read json from %s\n", __FUNCTION__, __LINE__, filename);
+	Asj_Ai_Cfg_t *ai_config; 
+	ai_config = (Asj_Ai_Cfg_t *)malloc(sizeof(Asj_Ai_Cfg_t));
+	memset(ai_config, 0, sizeof(Asj_Ai_Cfg_t));
+	try{
+		read_Asj_Ai_Json(ai_config, filename);
+	} catch (const std::exception &e) {
+		VX_LOG("%s Line:%d read json error..\n", __FUNCTION__, __LINE__);
+		return NULL;
+	}
+
+    vx_int8* net;
+	vx_int8* blobs;
+    nna_yolo_private_t *yolo;
+    std::vector<std::string> input_blobs_name;
+	std::vector<vx_tensor> input_blobs_tensor;
+	std::vector<std::string> output_blobs_name;
+	std::vector<vx_tensor> output_blobs_tensor;
+    vx_size input_data_dims[4] = { 1 };
+	vx_size output_data_dims[4] = { 1 };
+
+    yolo = (nna_yolo_private_t *)malloc(sizeof(nna_yolo_private_t));
+	memset(yolo, 0, sizeof(nna_yolo_private_t));
+
+	yolo->model_type = ai_config->property.model_type;
+	if (yolo->model_type == "yolov5"){
+		for (int i = 0; i < 18; i++){
+			yolo->anchors_g[i] = ai_config->property.anchors[i];
+		}
+	}
+	yolo->yolo_outputs_name_g = ai_config->property.yolo_outputs_name;
+	yolo->need_nu_freq = ai_config->property.need_nu_freq;
+	yolo->freq_nu = ai_config->property.freq_nu;
+	yolo->need_vu_freq = ai_config->property.need_vu_freq;
+	yolo->freq_vu = ai_config->property.freq_vu;
+	yolo->conf_thresh = ai_config->class_attrs_all.conf_thresh;
+	yolo->iou_thresh = ai_config->class_attrs_all.iou_thresh;
+	yolo->label = ai_config->property.label;
+
+    if (yolo == NULL) {
+		VX_LOG("%s Line:%d malloc yolo error\n", __FUNCTION__, __LINE__);
+		return NULL;
+	}
+
+    yolo->context = vxCreateContext();
+    ERROR_CHECK_OBJECT(yolo->context);
+
+	ERROR_CHECK_STATUS(vxLoadKernels(yolo->context, "openvx-nn"));
+	ERROR_CHECK_STATUS(LoadNetModel(yolo->context, ai_config->property.ezbStr, true, &net));
+	ERROR_CHECK_STATUS(LoadNetModel(yolo->context, ai_config->property.binStr, true, &blobs));
+
+    yolo->graph = CreateNetGraph(yolo->context, (vx_uint32*)net, blobs, true);
+    ERROR_CHECK_STATUS(vxVerifyGraph(yolo->graph));
+
+	vx_int32 graph_mem = vxGetGraphInOutMemorySize(yolo->graph);
+	VX_LOG("%s Line:%d graph_mem:%d.\n", __FUNCTION__, __LINE__, graph_mem);
+
+	// ERROR_CHECK_STATUS(vxProfileGraph(yolo->graph));
+	// VX_LOG("%s Line:%d vxProfileGraph success.\n", __FUNCTION__, __LINE__, graph_mem);
+
+    UnLoadNetModel(blobs);
+	UnLoadNetModel(net);
+
+    GetNetInputBlob(yolo->graph, input_blobs_name, input_blobs_tensor);
+	ERROR_CHECK_STATUS(vxQueryTensor(input_blobs_tensor.at(0), VX_TENSOR_DIMS, input_data_dims, sizeof(input_data_dims)));
+
+    yolo->net_w = input_data_dims[0];
+	yolo->net_h = input_data_dims[1];
+
+    yolo->src_w = cfg->width;
+    yolo->src_h = cfg->height;
+
+	yolo->scale_info = std::min(yolo->net_w * 1.0 / yolo->src_w, yolo->net_h * 1.0 / yolo->src_h);
+
+	yolo->handle_context = vxCreateContext();
+    ERROR_CHECK_OBJECT(yolo->handle_context);
+
+	VX_LOG("%s Line:%d before AllocDeviceImageBuffer.\n", __FUNCTION__, __LINE__);
+	yolo->dst_handle = AllocDeviceImageBuffer(yolo->handle_context, NNA_BGRA, yolo->net_w, yolo->net_h);
+    if (yolo->dst_handle == 0) {
+        VX_LOG("%s Line:%d alloc rgba image buffer error.\n", __FUNCTION__, __LINE__);
+        return NULL;
+    }
+	VX_LOG("%s Line:%d AllocDeviceImageBuffer success.\n", __FUNCTION__, __LINE__);
+
+	VX_LOG("%s Line:%d yolo->model_type:%s yolo->net_w:%d yolo->net_h:%d yolo->src_w:%d yolo->src_h:%d yolo->scale_info:%f\n", __FUNCTION__, __LINE__, yolo->model_type.c_str(), yolo->net_w, yolo->net_h, yolo->src_w, yolo->src_h,
+	yolo->scale_info);
+    input_blobs_name.clear();
+	input_blobs_tensor.clear();
+
+	GetNetOutputBlob(yolo->graph, output_blobs_name, output_blobs_tensor);
+	ERROR_CHECK_STATUS(vxQueryTensor(output_blobs_tensor.at(0), VX_TENSOR_DIMS, output_data_dims, sizeof(output_data_dims)));
+	yolo->nBlobSz = output_blobs_tensor.size();
+	yolo->pOutTensor.nTensor = (ax_nna_tensor_t*)AX_MALLOC(sizeof(ax_nna_tensor_t)*output_blobs_tensor.size());
+	yolo->pOutTensor.nTensorNum = output_blobs_tensor.size();
+
+	for (vx_size i = 0; i < output_blobs_tensor.size(); ++i) {
+		vx_size output_layer_data_dims[4];
+		vx_tensor layer_output = output_blobs_tensor[i];
+		ERROR_CHECK_STATUS(vxQueryTensor(layer_output, VX_TENSOR_DIMS, output_layer_data_dims, sizeof(output_layer_data_dims)));
+		yolo->pOutTensor.nTensor[i].w = output_layer_data_dims[0];
+		yolo->pOutTensor.nTensor[i].h = output_layer_data_dims[1];
+		yolo->pOutTensor.nTensor[i].c = output_layer_data_dims[2];
+		yolo->pOutTensor.nTensor[i].n = output_layer_data_dims[3];
+		yolo->strides[i] = int(yolo->net_w / yolo->pOutTensor.nTensor[i].w);
+
+		vx_size fl;
+		ERROR_CHECK_STATUS(vxQueryTensor(layer_output, VX_TENSOR_FIXED_POINT_POSITION, &fl, sizeof(fl)));
+		yolo->pOutTensor.nTensor[i].fl = fl;
+
+		VX_LOG("%s Line:%d %dth layer output_data_dims:[%d,%d,%d,%d] fl:%d strides:[%d]\n", __FUNCTION__, __LINE__, i + 1, yolo->pOutTensor.nTensor[i].w, yolo->pOutTensor.nTensor[i].h, 
+		yolo->pOutTensor.nTensor[i].c, yolo->pOutTensor.nTensor[i].n, yolo->pOutTensor.nTensor[i].fl, yolo->strides[i]);
+	}
+
+    return yolo;
+}
+
+static std::vector<Box> post_process(void *hdl, std::vector<std::string>& output_blobs_name,
+		std::vector<vx_tensor>& output_blobs_tensor, float conf_thresh, float iou_thresh)
+{
+	nna_yolo_private_t *yolo = (nna_yolo_private_t *)hdl;
+    std::map<std::string, int> output_blobs_name_to_index;
+    for(size_t i = 0;i < output_blobs_name.size(); ++i) {
+		output_blobs_name_to_index[output_blobs_name[i]] = i;
+        // VX_LOG("%s output_blobs_name_to_index[%s]=%d\n", __FUNCTION__, output_blobs_name[i].c_str(), i);
+	}
+
+	unsigned int image_size = yolo->net_h;
+	unsigned int *strides = yolo->strides;
+	unsigned int class_num = yolo->label.size();
+	
+	std::vector<Box> proposals;
+	for(size_t i = 0;i < yolo->yolo_outputs_name_g.size(); ++i){
+		int layer_index = output_blobs_name_to_index[yolo->yolo_outputs_name_g[i]];
+		vx_tensor layer_output = output_blobs_tensor[layer_index];
+		vx_int8* layer_output_ptr;
+		vx_size layer_output_dims[4]; // w,h,c,n
+		vx_enum data_type;
+
+		ERROR_CHECK_STATUS(vxQueryTensor(layer_output, VX_TENSOR_MEMORY_VIRT_ADDR, &layer_output_ptr, sizeof(layer_output_ptr)));
+		ERROR_CHECK_STATUS(vxQueryTensor(layer_output, VX_TENSOR_DIMS, &layer_output_dims, sizeof(layer_output_dims)));
+		ERROR_CHECK_STATUS(vxQueryTensor(layer_output, VX_TENSOR_DATA_TYPE, &data_type, sizeof(data_type)));
+		
+		// VX_LOG("%s Line:%d %s ptr:%d dim:[%d,%d,%d,%d] image_size:%d class_num:%d strides:%d dtype:%d\n", __FUNCTION__, __LINE__, yolo->yolo_outputs_name_g[layer_index].c_str(), layer_output_ptr, layer_output_dims[0]
+		// , layer_output_dims[1], layer_output_dims[2], layer_output_dims[3], image_size, class_num, strides[layer_index], data_type);
+
+		int status;
+		if (yolo->model_type == "yolov5"){
+			status = yolov5_layer(proposals, layer_output_ptr, layer_output_dims, image_size, strides[layer_index], yolo->pOutTensor.nTensor[layer_index].fl, data_type, yolo->anchors_g + i * 6, class_num, conf_thresh);
+		} else if (yolo->model_type == "yolov8"){
+			status = yolov8_layer(proposals, layer_output_ptr, layer_output_dims, image_size, strides[layer_index], yolo->pOutTensor.nTensor[layer_index].fl, data_type, class_num, conf_thresh);
+		}
+		
+		if (status != VX_SUCCESS) {
+			VX_LOG("%s Line:%d %dth layer yolov_layer error.\n", __FUNCTION__, __LINE__, i + 1);
+		}
+	}
+	std::vector<Box> boxes;
+	yolo_nms(proposals, iou_thresh);
+
+	return proposals;
+}
+
+
+int nna_custom_det_process(void *hdl, ezax_img_t *pImgIn, ezax_boxes_t *yolo_det_out, float conf_thresh, float iou_thresh)
+{
+	VX_LOG("%s Line:%d conf_thresh:%f iou_thresh:%f\n", __FUNCTION__, __LINE__, conf_thresh, iou_thresh);
+    nna_yolo_private_t *yolo = (nna_yolo_private_t *)hdl;
+
+    input_image input_img;
+    std::vector<std::string> input_blobs_name;
+	std::vector<vx_tensor> input_blobs_tensor;
+	std::vector<std::string> output_blobs_name;
+	std::vector<vx_tensor> output_blobs_tensor;
+	std::vector<Box> boxes;
+    vx_status status;
+
+	vx_size dst_virt_addr = vxGetDeviceMemoryVirtualAddress(yolo->dst_handle);
+	vx_size dst_phy_addr = vxGetDeviceMemoryPhysicalAddress(yolo->dst_handle);
+    vx_size dst_img_size = vxGetDeviceMemorySize(yolo->dst_handle);
+    vx_size dst_phy_addr_uv = dst_phy_addr + yolo->net_w * yolo->net_h;
+
+	img_cvt_param param;
+    param.input_fmt = (img_fmt)pImgIn->img_handle.fmt;
+    param.input_width = pImgIn->img_handle.w;
+    param.input_height = pImgIn->img_handle.h;
+    param.input_crop_x = 0;
+    param.input_crop_y = 0;
+    param.input_crop_w = pImgIn->img_handle.w;
+    param.input_crop_h = pImgIn->img_handle.h;
+    param.input_color_range = 0;
+    // param.output_fmt = (img_fmt)pImgIn->img_handle.fmt;
+	param.output_fmt = NNA_BGRA;
+    param.output_width = yolo->net_w;
+    param.output_height = yolo->net_h;
+    param.output_crop_x = 0;
+    param.output_crop_y = 0;
+    param.output_crop_w = int(pImgIn->img_handle.w * yolo->scale_info);
+    param.output_crop_h = int(pImgIn->img_handle.h * yolo->scale_info);
+	status = ImageConvert(yolo->handle_context, &param, pImgIn->img_handle.pPhy, pImgIn->img_handle.pPhy_UV, yolo->dst_handle);
+	vxInvalidateDeviceMemoryCache(yolo->handle_context, yolo->dst_handle);
+	if (status != VX_SUCCESS) {
+		VX_LOG("%s Line:%d ImageConvert error.\n", __FUNCTION__, __LINE__);
+        return VX_FAILURE;
+	} 
+	// else VX_LOG("%s Line:%d ImageConvert success.\n", __FUNCTION__, __LINE__);
+	// VX_LOG("%s Line:%d dst_phy_addr:%d dst_img_size:%d img_handle.w:%d img_handle.h:%d pImgIn->img_handle.sz:%d img_handle.c:%d img_handle.stride:%d fmt:%d\n", __FUNCTION__, __LINE__, dst_phy_addr, dst_img_size, pImgIn->img_handle.w, pImgIn->img_handle.h, pImgIn->img_handle.sz, pImgIn->img_handle.c, pImgIn->img_handle.stride, param.input_fmt);
+	
+    GetNetInputBlob(yolo->graph, input_blobs_name, input_blobs_tensor);
+	status = ImportNetInputDataFromMem(yolo->graph, input_blobs_name[0], dst_img_size, (vx_uint8*)dst_virt_addr, 0);
+
+	if (status != VX_SUCCESS) {
+		VX_LOG("%s Line:%d import data error.\n", __FUNCTION__, __LINE__);
+        return VX_FAILURE;
+	} 
+	// else VX_LOG("%s Line:%d import data success.\n", __FUNCTION__, __LINE__);
+    input_blobs_name.clear();
+	input_blobs_tensor.clear();
+
+    ERROR_CHECK_STATUS(vxProcessGraph(yolo->graph));
+
+    status = vxFinish(yolo->context);
+	if (status != VX_SUCCESS) {
+		VX_LOG("%s Line:%d vxFinish error.\n", __FUNCTION__, __LINE__);
+		return VX_FAILURE;
+	} 
+	// else VX_LOG("%s Line:%d vxFinish success.\n", __FUNCTION__, __LINE__);
+    status = GetNetOutputBlob(yolo->graph, output_blobs_name, output_blobs_tensor);
+	if (status != VX_SUCCESS) {
+		VX_LOG("%s Line:%d GetNetOutputBlob error.\n", __FUNCTION__, __LINE__);
+		return VX_FAILURE;
+	} 
+	// else VX_LOG("%s Line:%d GetNetOutputBlob success.\n", __FUNCTION__, __LINE__);
+	boxes = post_process(yolo, output_blobs_name, output_blobs_tensor, conf_thresh, iou_thresh);
+	for (unsigned int i = 0; i < boxes.size(); i++) {
+		Box box = boxes[i];
+		ezax_rt_t *prect = &yolo_det_out->pRect[i];
+
+		if (i >= MAX_CLASSIFICATION_DET_NUM) {
+			break;
+		}
+
+		prect->x0 = (int)((box.xyxy[0]) / yolo->scale_info);
+		prect->y0 = (int)((box.xyxy[1]) / yolo->scale_info);
+		prect->x1 = (int)((box.xyxy[2]) / yolo->scale_info);
+		prect->y1 = (int)((box.xyxy[3]) / yolo->scale_info);
+
+		CLIPRETINA(prect->x0, 0, yolo->src_w);
+		CLIPRETINA(prect->y0, 0, yolo->src_h);
+		CLIPRETINA(prect->x1, 0, yolo->src_w);
+		CLIPRETINA(prect->y1, 0, yolo->src_h);
+
+		prect->s  = box.score;
+		prect->c  = box.index;
+		// VX_LOG("%s Line:%d final box x0:%d y0:%d x1:%d y1:%d score:%f c_index:%d\n", __FUNCTION__, __LINE__, prect->x0, prect->y0, prect->x1, prect->y1, prect->s, prect->c);
+	}
+	yolo_det_out->num = (boxes.size() > MAX_CLASSIFICATION_DET_NUM) ? MAX_CLASSIFICATION_DET_NUM : boxes.size();
+    return VX_SUCCESS;
+}
+
+int nna_custom_det_close(void *hdl)
+{
+	nna_yolo_private_t *yolo = (nna_yolo_private_t *)hdl;
+	vxInvalidateDeviceMemoryCacheAll(yolo->context);
+	vxInvalidateDeviceMemoryCacheAll(yolo->handle_context);
+	ERROR_CHECK_STATUS(vxReleaseGraph(&yolo->graph));
+	ERROR_CHECK_STATUS(vxUnloadKernels(yolo->context, "openvx-nn"));
+	ERROR_CHECK_STATUS(vxReleaseContext(&yolo->context));
+	ERROR_CHECK_STATUS(vxReleaseContext(&yolo->handle_context));
+	
+	if (yolo)
+		free(yolo);
+	VX_LOG("%s Line:%d done.\n", __FUNCTION__, __LINE__);
+	return VX_SUCCESS;
+}
+
+int  nna_custom_det_cmd(void *hdl, ezax_custom_det_cmd_t cmd, unsigned int args)
+{
+	nna_yolo_private_t *yolo = (nna_yolo_private_t *)hdl;
+	// switch (cmd) {
+	// 	ezax_freq_t *pfreq = (ezax_freq_t*)args;
+	// 	case EZAX_YOLO_RESET_AXFREQ:
+	// 	{
+	// 		if(pfreq) {
+	// 			int dev_id = pfreq->id;
+	// 			int freq = pfreq->freq;
+	// 			int pre_freq, set_freq;;
+	// 			vxGetDeviceFreq(yolo->context, "nu", pre_freq);
+	// 			vxSetDeviceFreq(yolo->context, "nu", freq);
+	// 			vxGetDeviceFreq(yolo->context, "nu", set_freq);
+	// 			VX_LOG("%s RESET_AXFREQ pre_freq:%d set_freq:%d\n", __FUNCTION__, pre_freq, set_freq);
+	// 		}
+	// 	}
+
+	// 	case EZAX_YOLO_GET_AXFREQ:
+	// 	{
+			
+	// 	}
+	// }
+	return VX_SUCCESS;
+}

+ 36 - 0
yolo_test/Makefile

@@ -0,0 +1,36 @@
+SDK_ROOT := $(PWD)/../../../
+CC := $(SDK_ROOT)/toolchain/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-c++
+AX_LIBS :=$(SDK_ROOT)/frameworks/nn/lib/n7v3/armhf
+SDK_LIBS := $(SDK_ROOT)/system/mdp/build/platform/lib
+
+PROG := nn_yolo_test
+
+SOURCES := \
+	./yolo_test.cpp \
+	./utils.cpp \
+
+INCLUDE_PATH += -I ./../include/
+INCLUDE_PATH += -I ./../include/libnn/
+INCLUDE_PATH += -I ./../include/VX
+INCLUDE_PATH += -I ./../include/VX_EXT/
+INCLUDE_PATH += -I $(SDK_ROOT)/system/mdp/out/n7v3/armhf/glibc/release/include/mbase/
+
+CFLAGS += $(INCLUDE_PATH)
+
+CFLAGS += -O2
+
+CPPFLAGS += -frtti
+
+LDFLAGS += -L $(AX_LIBS)/ -lopenvx -lopenvx-nn -lnn -lnn_base
+LDFLAGS += -L ./../yolo/ -lnn_yolo
+LDFLAGS += -L ./../libs/ -llog
+LDFLAGS += -lpthread -ldl
+
+LDFLAGS += -L $(SDK_LIBS) -lmbase -lax
+
+all: $(PROG)
+$(PROG): $(SOURCES)
+	$(CC) $(SOURCES) -o $@ $(CFLAGS) $(LDFLAGS)
+clean:
+	rm -f $(PROG)
+

二进制
yolo_test/nn_yolo_test


+ 234 - 0
yolo_test/utils.cpp

@@ -0,0 +1,234 @@
+
+#include "ax_test_utils.h"
+
+#ifdef __EOS__
+	#include <rtthread.h>
+#else
+	#ifdef _USE_LOMBO_MALLOC_
+	#include "lombo_malloc.h"
+	#else
+	#include "mi_mbase.h"
+	#endif
+#endif
+
+#ifndef u8
+typedef unsigned char u8;
+#endif
+
+#ifndef u16
+typedef unsigned short u16;
+#endif
+
+#define NN_LOMBO_COLOR_A(color)         (((color) >> 24) & 0xff)
+#define NN_LOMBO_COLOR_R(color)         (((color) >> 16) & 0xff)
+#define NN_LOMBO_COLOR_G(color)         (((color) >> 8) & 0xff)
+#define NN_LOMBO_COLOR_B(color)         ((color) & 0xff)
+
+static void rgb_to_yuv(int r, int g, int b, u8 *py, u8 *pu, u8 *pv)
+{
+    int result;
+    u8 y, u, v;
+
+    /* y:[16, 235] u/v:[16, 240] */
+    result = (r * 77 + g * 150 + b * 29) >> 8; // rgb to y
+    if (result < 16) {
+        y = 16;
+    } else if (result > 235) {
+        y = 235;
+    } else {
+        y = result;
+    }
+
+    result = ((r * (-44) - g * 87 + b * 131) >> 8) + 128; // rgb to u
+    if (result < 16) {
+        u = 16;
+    } else if (result > 240) {
+        u = 240;
+    } else {
+        u = result;
+    }
+
+    result = ((r * 131 - g * 110 - b * 21) >> 8) + 128; // rgb to v
+    if (result < 16) {
+        v = 16;
+    } else if (result > 240) {
+        v = 240;
+    } else {
+        v = result;
+    }
+
+    *py = y;
+    *pu = u;
+    *pv = v;
+}
+
+int drawrectback(char *y, int w, ezax_rt_t *pRect)
+{
+	int i = 0;
+	int j = 0;
+	int line_w = 4;
+
+	for (j = pRect->y0; j < pRect->y0 + line_w; j++)
+		memset(y + j*w + pRect->x0, 255, pRect->x1 - pRect->x0);
+
+	for (j = pRect->y1; j > pRect->y1 - line_w; j--)
+		memset(y + j*w + pRect->x0, 255, pRect->x1 - pRect->x0);
+
+	for (i = pRect->y0; i < pRect->y1; i++) {
+		for (j = 0; j < line_w; j++) {
+			*(y + i*w + pRect->x0 + j) = 255;
+			*(y + i*w + pRect->x1 - 1 -j) = 255;
+		}
+	}
+
+
+	return 0;
+}
+
+int drawrectback_c(char *y, int w, ezax_rt_t *pRect, int color)
+{
+	int i = 0;
+	int j = 0;
+	int line_w = 4;
+
+	int value_y = 0;
+	//int value_u = 0;
+	//int value_v = 0;
+
+	if (color == 0) {
+		value_y = 255;
+		//value_u = 255;
+		//value_v = 255;	
+	}
+
+	if (color == 1) {
+		value_y = 0;
+		//value_u = 0;
+		//value_v = 0;	
+	}
+
+	for (j = pRect->y0; j < pRect->y0 + line_w; j++)
+		memset(y + j*w + pRect->x0, value_y, pRect->x1 - pRect->x0);
+
+	for (j = pRect->y1; j > pRect->y1 - line_w; j--)
+		memset(y + j*w + pRect->x0, value_y, pRect->x1 - pRect->x0);
+
+	for (i = pRect->y0; i < pRect->y1; i++) {
+		for (j = 0; j < line_w; j++) {
+			*(y + i*w + pRect->x0 + j) = value_y;
+			*(y + i*w + pRect->x1 - 1 -j) = value_y;
+		}
+	}
+
+
+	return 0;
+}
+
+int draw_rect_with_color(char *y, int w, int h, ezax_rt_t *pRect, int color)
+{
+	int i = 0;
+	int j = 0;
+	int line_w = 4;
+
+	int r, g, b;
+
+	u8 value_y, value_u, value_v;
+	u16 uv;
+	u8 *uv_ptr;
+	u16 *temp16;
+
+	r = NN_LOMBO_COLOR_R(color);
+	g = NN_LOMBO_COLOR_G(color);
+	b = NN_LOMBO_COLOR_B(color);
+	rgb_to_yuv(r, g, b, &value_y, &value_u, &value_v);
+	uv = (value_v << 8) + value_u;
+
+	uv_ptr = (u8 *)(y + w * h);
+	//printf("rgb[%d %d %d]", r, g, b);
+	//printf("yuv[%d %d %d]", value_y, value_u, value_v);
+
+	for (i = pRect->y0; i < pRect->y0 + line_w; i++) {
+		memset(y + i*w + pRect->x0, value_y, pRect->x1 - pRect->x0);
+		temp16 = (u16 *)(uv_ptr + i / 2 * w);
+		for (j = pRect->x0 / 2; j < pRect->x1 / 2; j++) {
+			temp16[j] = uv;
+		}
+	}
+
+	for (i = pRect->y1; i > pRect->y1 - line_w; i--) {
+		memset(y + i * w + pRect->x0, value_y, pRect->x1 - pRect->x0);
+		temp16 = (u16 *)(uv_ptr + i / 2 * w);
+		for (j = pRect->x0 / 2; j < pRect->x1 / 2; j++) {
+			temp16[j] = uv;
+		}
+	}
+
+	for (i = pRect->y0; i < pRect->y1; i++) {
+		for (j = 0; j < line_w; j++) {
+			*(y + i * w + pRect->x0 + j) = value_y;
+			*(y + i * w + pRect->x1 - 1 -j) = value_y;
+		}
+		temp16 = (u16 *)(uv_ptr + i / 2 * w);
+		for (j = pRect->x0 / 2; j < (pRect->x0 + line_w) / 2; j++) {
+			temp16[j] = uv;
+		}
+		for (j = (pRect->x1 - line_w) / 2; j < pRect->x1 / 2; j++) {
+			temp16[j] = uv;
+		}
+	}
+
+	return 0;
+}
+
+void *ax_malloc_uncache(unsigned int *phy_addr, int size)
+{
+	void *vir_addr;
+#ifdef __EOS__
+	vir_addr = rt_zalloc_unca_align(size, 4096);
+	*phy_addr = unca_to_phys(vir_addr);
+#else
+	#ifdef _USE_LOMBO_MALLOC_
+		vir_addr = lombo_malloc(size, MEM_UC, (unsigned long *)phy_addr, __FILE__, __LINE__);
+	#else
+		EI_MI_MBASE_MemAlloc((unsigned long long *)phy_addr, &vir_addr, "pepdet_test", NULL, size);
+	#endif
+#endif
+	return vir_addr;
+}
+
+
+int ax_free_uncache(unsigned int phy_addr, void *viraddr)
+{
+#ifdef __EOS__
+	rt_free_unca_align(viraddr);
+#else
+	#ifdef _USE_LOMBO_MALLOC_
+		lombo_free(viraddr, MEM_UC);
+	#else
+		EI_MI_MBASE_MemFree(phy_addr, viraddr);
+	#endif
+#endif
+	return 0;
+}
+
+
+void *ax_realloc_virt(void *prt, int size)
+{
+	return realloc(prt, size);
+}
+
+
+
+void *ax_malloc_virt(int size)
+{
+	return malloc(size);
+}
+
+
+
+int ax_free_virt(void *prt)
+{
+	free(prt);
+	return 0;
+}
+

+ 105 - 0
yolo_test/yolo_test.cpp

@@ -0,0 +1,105 @@
+#include <stdio.h>
+#include <string.h>
+#include "yolo.h"
+#include "ax_test_utils.h"
+#include <vx_log.h>
+#include <iostream>
+
+int get_yuv(ezax_img_t &input){
+    int y_size = 384 * 640;
+    int uv_size = y_size / 2;
+
+    FILE *input_file = NULL;
+    char *input_file_name = (char *)"images.yuv";
+    input_file = fopen(input_file_name, "rb");
+	if (input_file == NULL) {
+		VX_LOG("%s fopen file %s error\n", __FUNCTION__, input_file_name);
+		return 1;
+	}
+
+    memset(&input, 0, sizeof(ezax_img_t));
+    input.img_handle.fmt = EZAX_YUV420_SP;
+    input.img_handle.w   = 640;
+	input.img_handle.h   = 384;
+	input.img_handle.c   = 2;
+	input.img_handle.stride   = 0;
+
+    input.roi.x0 = 0;
+	input.roi.y0 = 0;
+	input.roi.x1 = 640;
+	input.roi.y1 = 384;
+    input.img_handle.pVir = ax_malloc_uncache(&input.img_handle.pPhy, y_size + uv_size);
+	input.img_handle.pVir_UV = (void *)((char *)input.img_handle.pVir + y_size);
+	input.img_handle.pPhy_UV = input.img_handle.pPhy + y_size;
+
+    VX_LOG("%s y_size %d uv_size %d\n", __FUNCTION__, y_size, uv_size);
+	VX_LOG("%s input.img_handle.pVir : %p\n", __FUNCTION__, input.img_handle.pVir);
+	VX_LOG("%s input.img_handle.pPhy : %x\n", __FUNCTION__, input.img_handle.pPhy);
+
+    int len;
+    len = fread(input.img_handle.pVir, 1, y_size + uv_size, input_file);
+    if (len != (y_size + uv_size)) {
+        VX_LOG("%s fread error.\n");
+        return -1;
+    }
+    
+    VX_LOG("%s fread success\n", __FUNCTION__);
+    
+    return 0;
+}
+
+int yolo_test(){
+    int state;
+    ezax_img_t input;
+    ezax_boxes_t pOut;
+    ezax_custom_det_cfg_t cfg;
+    void *yolo_hdl;
+    float conf_thresh, iou_thresh;
+
+    conf_thresh = 0.35;
+    iou_thresh = 0.25;
+
+    cfg.width = 640;
+    cfg.height = 384;
+
+    VX_LOG("%s begin yolo_test.\n", __FUNCTION__);
+    yolo_hdl = nna_custom_det_open(&cfg);
+    if (yolo_hdl == NULL) {
+		VX_LOG("%s yolov_hdl open error\n", __FUNCTION__);
+		return 0;
+	}
+    VX_LOG("%s nna_custom_det_open success.\n", __FUNCTION__);
+
+    state = get_yuv(input);
+    if (state != VX_SUCCESS) {
+		VX_LOG("%s get_yuv error\n", __FUNCTION__);
+		return 0;
+	}
+    
+    pOut.pRect = (ezax_rt_t *)ax_malloc_virt(sizeof(ezax_rt_t) * MAX_CLASSIFICATION_DET_NUM);
+    pOut.num   = 0;
+    state = nna_custom_det_process(yolo_hdl, &input, &pOut, conf_thresh, iou_thresh);
+    if (state != VX_SUCCESS) {
+		VX_LOG("%s nna_yolo_det_process error\n", __FUNCTION__);
+		return 0;
+	}
+    std::cout << __LINE__ << std::endl;
+    state = nna_custom_det_close(yolo_hdl);
+    if (state != VX_SUCCESS) {
+		VX_LOG("%s nna_yolo_det_close error\n", __FUNCTION__);
+		return 0;
+	}
+    // free(&input);
+    // free(pOut.pRect);
+    std::cout << __LINE__ << std::endl;
+    while (1)
+    {
+        /* code */
+    }
+    return 1;
+}
+
+int main(int argc, char *argv[]){
+	yolo_test();
+	return 0;
+}

部分文件因为文件数量过多而无法显示