VzenseNebula_api.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. #ifndef VZENSEDS_API_H
  2. #define VZENSEDS_API_H
  3. /**
  4. * @file VzenseDS_api.h
  5. * @brief Vzense API header file.
  6. * Copyright (c) 2019-2022 Vzense Interactive, Inc.
  7. */
  8. /*! \mainpage VzenseDS API Documentation
  9. *
  10. * \section intro_sec Introduction
  11. *
  12. * Welcome to the VzenseDS API documentation. This documentation enables you to quickly get started in your development efforts to programmatically interact with the Vzense CW ToF Camera (eg:DS77).
  13. */
  14. #include "VzenseNebula_define.h"
  15. /**
  16. * @brief Initializes the API on the device. This function must be invoked before any other Vzense APIs.
  17. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  18. */
  19. VZENSE_C_API_EXPORT VzReturnStatus VZ_Initialize();
  20. /**
  21. * @brief Shuts down the API on the device and clears all resources allocated by the API. After invoking this function, no other Vzense APIs can be invoked.
  22. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  23. */
  24. VZENSE_C_API_EXPORT VzReturnStatus VZ_Shutdown();
  25. /**
  26. * @brief Gets the version of SDK.
  27. * @return Returns sdk version
  28. */
  29. VZENSE_C_API_EXPORT const char* VZ_GetSDKVersion();
  30. /**
  31. * @brief Returns the number of camera devices currently connected.
  32. * @param[out] pDeviceCount Pointer to a 32-bit integer variable in which to return the device count.
  33. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  34. */
  35. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetDeviceCount(uint32_t* pDeviceCount);
  36. /**
  37. * @brief Returns the info of the deviceIndex camera device.
  38. * @param[in] deviceIndex The index of the device to open. Device indices range from 0 to device count - 1.
  39. * @param[out] pDevicesInfo Pointer to a buffer in which to store the device info.
  40. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  41. */
  42. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetDeviceInfo(uint32_t deviceIndex, VzDeviceInfo* pDevicesInfo);
  43. /**
  44. * @brief Returns the info lists of the deviceCount camera devices.
  45. * @param[in] deviceCount the number of camera devices.
  46. * @param[out] pDevicesInfoList Pointer to a buffer in which to store the devices list infos.
  47. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  48. */
  49. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetDeviceInfoList(uint32_t deviceCount, VzDeviceInfo* pDevicesInfoList);
  50. /**
  51. * @brief Opens the device specified by <code>sn</code>. The device must be subsequently closed using VZ_CloseDevice().
  52. * @param[in] pURI the uri of the device. See ::VzDeviceInfo for more information.
  53. * @param[out] pDevice the handle of the device on which to open.
  54. * @return: ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  55. */
  56. VZENSE_C_API_EXPORT VzReturnStatus VZ_OpenDeviceByUri(const char* pURI, VzDeviceHandle* pDevice);
  57. /**
  58. * @brief Opens the device specified by <code>alias</code>. The device must be subsequently closed using VZ_CloseDevice().
  59. * @param[in] pAlias the alias of the device. See ::VzDeviceInfo for more information.
  60. * @param[out] pDevice the handle of the device on which to open.
  61. * @return: ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  62. */
  63. VZENSE_C_API_EXPORT VzReturnStatus VZ_OpenDeviceByAlias(const char* pAlias, VzDeviceHandle* pDevice);
  64. /**
  65. * @brief Opens the device specified by <code>ip</code>. The device must be subsequently closed using VZ_CloseDevice().
  66. * @param[in] pIP the ip of the device. See ::VzDeviceInfo for more information.
  67. * @param[out] pDevice the handle of the device on which to open.
  68. * @return: ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  69. */
  70. VZENSE_C_API_EXPORT VzReturnStatus VZ_OpenDeviceByIP(const char* pIP, VzDeviceHandle* pDevice);
  71. /**
  72. * @brief Closes the device specified by <code>device</code> that was opened using VZ_OpenDevice.
  73. * @param[in] pDevice The handle of the device to close.
  74. * @return: ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  75. */
  76. VZENSE_C_API_EXPORT VzReturnStatus VZ_CloseDevice(VzDeviceHandle* pDevice);
  77. /**
  78. * @brief Starts capturing the image stream indicated by <code>device</code>. Invoke VZ_StopStream() to stop capturing the image stream.
  79. * @param[in] device The handle of the device on which to start capturing the image stream.
  80. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  81. */
  82. VZENSE_C_API_EXPORT VzReturnStatus VZ_StartStream(VzDeviceHandle device);
  83. /**
  84. * @brief Stops capturing the image stream on the device specified by <code>device</code>. that was started using VZ_StartStream.
  85. * @param[in] device The handle of the device on which to stop capturing the image stream.
  86. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  87. */
  88. VZENSE_C_API_EXPORT VzReturnStatus VZ_StopStream(VzDeviceHandle device);
  89. /**
  90. * @brief Captures the next image frame from the device specified by <code>device</code>. This API must be invoked before capturing frame data using VZ_GetFrame().
  91. * @param[in] device The handle of the device on which to read the next frame.
  92. * @param[in] waitTime The unit is millisecond, the value is in the range (0,65535).
  93. * You can change the value according to the frame rate. For example,the frame rate is 30, so the theoretical waittime interval is 33ms, but if set the time value is 20ms,
  94. * it means the max wait time is 20 ms when capturing next frame, so when call the VZ_GetFrameReady, it may return VzRetGetFrameReadyTimeOut(-11).
  95. * So the recommended value is 2 * 1000/ FPS.
  96. * @param[out] pFrameReady Pointer to a buffer in which to store the signal on which image is ready to be get.
  97. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  98. */
  99. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetFrameReady(VzDeviceHandle device, uint16_t waitTime, VzFrameReady* pFrameReady);
  100. /**
  101. * @brief Returns the image data for the current frame from the device specified by <code>device</code>. Before invoking this API, invoke VZ_GetFrameReady() to capture one image frame from the device.
  102. * @param[in] device The handle of the device to capture an image frame from.
  103. * @param[in] frameType The image frame type.
  104. * @param[out] pVzFrame Pointer to a buffer in which to store the returned image data.
  105. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  106. */
  107. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetFrame(VzDeviceHandle device, VzFrameType frameType, VzFrame* pVzFrame);
  108. /**
  109. * @brief Set the working mode of the camera.
  110. * @param[in] device The handle of the device
  111. * @param[in] mode The work mode of camera. For ActiveMode, set the Time filter default true, for SlaveMode, set the Time filter default false.
  112. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  113. */
  114. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetWorkMode(VzDeviceHandle device, VzWorkMode mode);
  115. /**
  116. * @brief Get the working mode of the camera.
  117. * @param[in] device The handle of the device
  118. * @param[in] pMode The work mode of camera.
  119. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  120. */
  121. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetWorkMode(VzDeviceHandle device, VzWorkMode* pMode);
  122. /**
  123. * @brief Triggering a frame of image is only useful if the camera is in SoftwareTriggerMode
  124. * @param[in] device The handle of the device.
  125. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  126. */
  127. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetSoftwareSlaveTrigger(VzDeviceHandle device);
  128. /**
  129. * @brief Returns the internal intrinsic and distortion coefficient parameters from the device specified by <code>device</code>.
  130. * @param[in] device The handle of the device from which to get the internal parameters.
  131. * @param[in] sensorType The type of sensor (depth or color) from which to get parameter information. Pass in the applicable value defined by ::VzSensorType.
  132. * @param[out] pSensorIntrinsicParameters Pointer to a VzSensorIntrinsicParameters variable in which to store the parameter values.
  133. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  134. */
  135. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetSensorIntrinsicParameters(VzDeviceHandle device, VzSensorType sensorType, VzSensorIntrinsicParameters* pSensorIntrinsicParameters);
  136. /**
  137. * @brief Returns the camera rotation and translation coefficient parameters from the device specified by <code>device</code>.
  138. * @param[in] device The handle of the device from which to get the extrinsic parameters.
  139. * @param[out] pSensorExtrinsicParameters Pointer to a ::VzSensorExtrinsicParameters variable in which to store the parameters.
  140. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  141. */
  142. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetSensorExtrinsicParameters(VzDeviceHandle device, VzSensorExtrinsicParameters* pSensorExtrinsicParameters);
  143. /**
  144. * @brief Gets the firmware version number.
  145. * @param[in] device The handle of the device on which to set the pulse count.
  146. * @param[in] pFirmwareVersion Pointer to a variable in which to store the returned fw value.
  147. * @param[in] length The maximum length is 64 bytes.
  148. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  149. */
  150. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetFirmwareVersion(VzDeviceHandle device, char* pFirmwareVersion, int length);
  151. /**
  152. * @brief Gets the MAC from the device specified by <code>device</code>.
  153. * @param[in] device The handle of the device.
  154. * @param[out] pMACAddress Pointer to a buffer in which to store the device MAC address. the buffer default size is 18, and the last buffer set '\0'.
  155. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  156. */
  157. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetDeviceMACAddress(VzDeviceHandle device, char* pMACAddress);
  158. /**
  159. * @brief Sets the device GMM gain on a device.
  160. * @param[in] device The handle of the device on which to set the GMM gain.
  161. * @param[in] gmmgain The GMM gain value to set. See ::VzGMMGain for more information.The GMM gain value is in the range [0,255].
  162. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  163. */
  164. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetIRGMMGain(VzDeviceHandle device, uint8_t gmmgain);
  165. /**
  166. * @brief Returns the the device's GMM gain.
  167. * @param[in] device The handle of the device from which to get the GMM gain.
  168. * @param[out] pGmmgain Pointer to a variable in which to store the returned GMM gain.
  169. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  170. */
  171. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetIRGMMGain(VzDeviceHandle device, uint8_t* pGmmgain);
  172. /**
  173. * @brief Sets the color image pixel format on the device specified by <code>device</code>. Currently only RGB and BGR formats are supported.
  174. * @param[in] device The handle of the device to set the pixel format.
  175. * @param[in] pixelFormat The color pixel format to use. Pass in one of the values defined by ::VzPixelFormat. Currently only <code>VzPixelFormatRGB888</code> and <code>VzPixelFormatBGR888</code> are supported.
  176. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  177. */
  178. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetColorPixelFormat(VzDeviceHandle device, VzPixelFormat pixelFormat);
  179. /**
  180. * @brief Sets the color frame Resolution.
  181. * @param[in] device The handle of the device.
  182. * @param[in] w The width of color image
  183. * @param[in] h The height of color image
  184. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  185. */
  186. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetColorResolution(VzDeviceHandle device, int w, int h);
  187. /**
  188. * @brief Returns the the color frame Resolution.
  189. * @param[in] device The handle of the device.
  190. * @param[out] pW The width of color image
  191. * @param[out] pH The height of color image
  192. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  193. */
  194. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetColorResolution(VzDeviceHandle device, int* pW, int* pH);
  195. /**
  196. * @brief Gets a list of image resolutions supported by Sensor
  197. * @param[in] type The sensor type
  198. * @param[out] pList List of supported resolutions
  199. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  200. */
  201. VZENSE_C_API_EXPORT VzReturnStatus VzGetSupportedResolutionList(VzDeviceHandle device, VzSensorType type, VzResolutionList* pList);
  202. /**
  203. * @brief Sets the ToF frame rate.The interface takes a long time, about 500 ms.
  204. * @param[in] device The handle of the device on which to set the framerate.
  205. * @param[in] value The rate value, in range [1,25].
  206. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  207. */
  208. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetFrameRate(VzDeviceHandle device, int value);
  209. /**
  210. * @brief Gets the ToF frame rate.
  211. * @param[in] device The handle of the device on which to get the framerate.
  212. * @param[in] pValue The rate value.
  213. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  214. */
  215. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetFrameRate(VzDeviceHandle device, int* pValue);
  216. /**
  217. * @brief Set the exposure mode of sensor.
  218. * @param[in] device The handle of the device on which to set the exposure control mode.
  219. * @param[in] sensorType The type of sensor (depth or color) from which to get parameter information. Pass in the applicable value defined by ::VzSensorType.
  220. * @param[in] exposureType the exposure control mode.
  221. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  222. */
  223. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetExposureControlMode(VzDeviceHandle device, VzSensorType sensorType, VzExposureControlMode controlMode);
  224. /**
  225. * @brief Get the exposure mode of sensor.
  226. * @param[in] device The handle of the device on which to get the exposure control mode.
  227. * @param[in] sensorType The type of sensor (depth or color) from which to get parameter information. Pass in the applicable value defined by ::VzSensorType.
  228. * @param[out] pControlMode the exposure control mode.
  229. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  230. */
  231. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetExposureControlMode(VzDeviceHandle device, VzSensorType sensorType, VzExposureControlMode* pControlMode);
  232. /**
  233. * @brief Set the exposure time of sensor.
  234. * @param[in] device The handle of the device on which to set the exposure time in microseconds.
  235. * @param[in] sensorType The type of sensor (depth or color) from which to get parameter information. Pass in the applicable value defined by ::VzSensorType.
  236. * @param[in] exposureTime the exposure time.
  237. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  238. */
  239. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetExposureTime(VzDeviceHandle device, VzSensorType sensorType, VzExposureTimeParams exposureTime);
  240. /**
  241. * @brief Get the exposure time of sensor.
  242. * @param[in] device The handle of the device on which to get the exposure time in microseconds.
  243. * @param[in] sensorType The type of sensor (depth or color) from which to get parameter information. Pass in the applicable value defined by ::VzSensorType.
  244. * @param[out] pExposureTime the exposure time.
  245. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  246. */
  247. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetExposureTime(VzDeviceHandle device, VzSensorType sensorType, VzExposureTimeParams* pExposureTime);
  248. /**
  249. * @brief Set the parameters of the Time filter.
  250. * @param[in] device The handle of the device
  251. * @param[in] params Pointer to a variable in which to store the parameters.
  252. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  253. */
  254. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetTimeFilterParams(VzDeviceHandle device, VzTimeFilterParams params);
  255. /**
  256. * @brief Get the parameters of the Time Filter feature.
  257. * @param[in] device The handle of the device
  258. * @param[out] pParams Pointer to a variable in which to store the returned value.
  259. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  260. */
  261. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetTimeFilterParams(VzDeviceHandle device, VzTimeFilterParams *pParams);
  262. /**
  263. * @brief Set the parameters of the Confidence filter.
  264. * @param[in] device The handle of the device
  265. * @param[out] params Pointer to a variable in which to store the parameters.
  266. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  267. */
  268. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetConfidenceFilterParams(VzDeviceHandle device, VzConfidenceFilterParams params);
  269. /**
  270. * @brief Get the parameters of the ConfidenceFilter feature.
  271. * @param[in] device The handle of the device
  272. * @param[out] pParams Pointer to a variable in which to store the returned value.
  273. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  274. */
  275. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetConfidenceFilterParams(VzDeviceHandle device, VzConfidenceFilterParams *pParams);
  276. /**
  277. * @brief Set the parameters of the FlyingPixel filter.
  278. * @param[in] device The handle of the device.
  279. * @param[out] params Pointer to a variable in which to store the parameters.
  280. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  281. */
  282. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetFlyingPixelFilterParams(VzDeviceHandle device, const VzFlyingPixelFilterParams params);
  283. /**
  284. * @brief Get the parameters of the Confidence filter.
  285. * @param[in] device The handle of the device
  286. * @param[out] pParams Pointer to a variable in which to store the returned value.
  287. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  288. */
  289. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetFlyingPixelFilterParams(VzDeviceHandle device, VzFlyingPixelFilterParams* params);
  290. /**
  291. * @brief Enables or disables the FillHole filter
  292. * @param[in] device The handle of the device.
  293. * @param[in] bEnabled Set to <code>true</code> to enable the feature or <code>false</code> to disable the feature.
  294. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  295. */
  296. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetFillHoleFilterEnabled(VzDeviceHandle device, bool bEnabled);
  297. /**
  298. * @brief Returns the Boolean value of whether the FillHole Filter feature is enabled or disabled.
  299. * @param[in] device The handle of the device
  300. * @param[out] pEnabled Pointer to a variable in which to store the returned Boolean value.
  301. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  302. */
  303. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetFillHoleFilterEnabled(VzDeviceHandle device, bool *pEnabled);
  304. /**
  305. * @brief Enables or disables the Spatial filter
  306. * @param[in] device The handle of the device.
  307. * @param[in] bEnabled Set to <code>true</code> to enable the feature or <code>false</code> to disable the feature.
  308. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  309. */
  310. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetSpatialFilterEnabled(VzDeviceHandle device, bool bEnabled);
  311. /**
  312. * @brief Returns the Boolean value of whether the Spatial Filter feature is enabled or disabled.
  313. * @param[in] device The handle of the device
  314. * @param[out] pEnabled Pointer to a variable in which to store the returned Boolean value.
  315. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  316. */
  317. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetSpatialFilterEnabled(VzDeviceHandle device, bool *pEnabled);
  318. /**
  319. * @brief Enables or disables transforms a color image into the geometry of the depth sensor. When enabled, VZ_GetFrame() can\n
  320. * be invoked passing ::VzTransformedColorFrame as the frame type for get a color image which each pixel matches the \n
  321. * corresponding pixel coordinates of the depth sensor. The resolution of the transformed color frame is the same as that\n
  322. * of the depth image.
  323. * @param[in] device The handle of the device on which to enable or disable mapping.
  324. * @param[in] bEnabled Set to <code>true</code> to enable the feature or <code>false</code> to disable the feature.
  325. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  326. */
  327. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetTransformColorImgToDepthSensorEnabled(VzDeviceHandle device, bool bEnabled);
  328. /**
  329. * @brief Returns the Boolean value of whether the transformed of the color image to depth sensor space feature is enabled or disabled.
  330. * @param[in] device The handle of the device on which to enable or disable the feature.
  331. * @param[out] bEnabled Pointer to a variable in which to store the returned Boolean value.
  332. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  333. */
  334. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetTransformColorImgToDepthSensorEnabled(VzDeviceHandle device, bool *bEnabled);
  335. /**
  336. * @brief Enables or disables transforms the depth map into the geometry of the color sensor. When enabled, VZ_GetFrame() can\n
  337. * be invoked passing ::VzTransformedDepthFrame as the frame type for get a depth image which each pixel matches the \n
  338. * corresponding pixel coordinates of the color sensor. The resolution of the transformed depth frame is the same as that\n
  339. * of the color image.
  340. * @param[in] device The handle of the device on which to enable or disable mapping.
  341. * @param[in] bEnabled Set to <code>true</code> to enable the feature or <code>false</code> to disable the feature.
  342. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  343. */
  344. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetTransformDepthImgToColorSensorEnabled(VzDeviceHandle device, bool bEnabled);
  345. /**
  346. * @brief Returns the Boolean value of whether the transformed of the depth image to color space feature is enabled or disabled.
  347. * @param[in] device The handle of the device on which to enable or disable the feature.
  348. * @param[out] bEnabled Pointer to a variable in which to store the returned Boolean value.
  349. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  350. */
  351. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetTransformDepthImgToColorSensorEnabled(VzDeviceHandle device, bool *bEnabled);
  352. /**
  353. * @brief Returns the point value of the frame that the mapping of the depth image to Color space.
  354. * @param[in] device The handle of the device on which to enable or disable the feature.
  355. * @param[in] pointInDepth The point in depth frame.
  356. * @param[in] colorSize The size(x = w,y = h) of color frame.
  357. * @param[out] pPointInColor The point in the color frame.
  358. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  359. */
  360. VZENSE_C_API_EXPORT VzReturnStatus VZ_TransformedDepthPointToColorPoint(const VzDeviceHandle device, const VzDepthVector3 depthPoint, const VzVector2u16 colorSize, VzVector2u16* pPointInColor);
  361. /**
  362. * @brief Converts the input points from depth coordinate space to world coordinate space.
  363. * @param[in] device The handle of the device on which to perform the operation.
  364. * @param[in] pDepthVector Pointer to a buffer containing the x, y, and z values of the depth coordinates to be converted. \n
  365. * x and y are measured in pixels, where 0, 0 is located at the top left corner of the image. \n
  366. * z is measured in millimeters, based on the ::VzPixelFormat depth frame.
  367. * @param[out] pWorldVector Pointer to a buffer in which to output the converted x, y, and z values of the world coordinates, measured in millimeters.
  368. * @param[in] pointCount The number of points to convert.
  369. * @param[in] pSensorParam The intrinsic parameters for the depth sensor. See ::VzSensorIntrinsicParameters.
  370. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  371. */
  372. VZENSE_C_API_EXPORT VzReturnStatus VZ_ConvertDepthToPointCloud(VzDeviceHandle device, VzDepthVector3* pDepthVector, VzVector3f* pWorldVector, int32_t pointCount, VzSensorIntrinsicParameters* pSensorParam);
  373. /**
  374. * @brief Converts the input Depth frame from depth coordinate space to world coordinate space on the device. Currently supported depth image types are VzDepthFrame and VzTransformDepthImgToColorSensorFrame.
  375. * @param[in] device The handle of the device on which to perform the operation.
  376. * @param[in] pDepthFrame The depth frame.
  377. * @param[out] pWorldVector Pointer to a buffer in which to output the converted x, y, and z values of the world coordinates, measured in millimeters. The length of pWorldVector must is (VzFrame.width * VzFrame.height).
  378. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  379. */
  380. VZENSE_C_API_EXPORT VzReturnStatus VZ_ConvertDepthFrameToPointCloudVector(VzDeviceHandle device, const VzFrame* pDepthFrame, VzVector3f* pWorldVector);
  381. /**
  382. * @brief Sets hotplug status callback function
  383. * @param[in] pCallback Pointer to the callback function. See ::PtrHotPlugStatusCallback
  384. * @param[in] pUserData Pointer to the user data. See ::PtrHotPlugStatusCallback
  385. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  386. */
  387. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetHotPlugStatusCallback(PtrHotPlugStatusCallback pCallback, const void* pUserData);
  388. /**
  389. * @brief Reboot the camera.
  390. * @param[in] device The handle of the device
  391. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  392. */
  393. VZENSE_C_API_EXPORT VzReturnStatus VZ_RebootDevie(VzDeviceHandle device);
  394. /**
  395. * @brief Set the corresponding property value for the device
  396. * @param[in] device The handle of the device from which to set the property value.
  397. * @param[in] propertyKey The type of property to set on the device.
  398. * @param[in] pData Pointer to a buffer containing the property value.
  399. * @param[in] dataSize The size, in bytes, of the property value contained in pData
  400. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  401. */
  402. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetProperty(VzDeviceHandle device, const char* propertyKey, const void* pData, uint32_t dataSize);
  403. /**
  404. * @brief Returns a specific property value from the device
  405. * @param[in] device The handle of the device from which to get the property value.
  406. * @param[in] propertyType The type of property to get from the device
  407. * @param[out] pData Pointer to a buffer to store the returned property value.
  408. * @param[in] dataSize The size, in bytes, of the property value returned in pData
  409. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  410. */
  411. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetProperty(VzDeviceHandle device, const char* propertyKey, void* pData, uint32_t dataSize);
  412. /**
  413. * @brief Enables or disables the HDR Mode of the ToF sensor with VzExposureControlMode_Manual. Default enabled, so if you want switch to the VzExposureControlMode_Auto, set HDR Mode disable firstly.
  414. * @param[in] device The handle of the device on which to enable or disable the feature.
  415. * @param[in] bEnabled Set to <code>true</code> to enable the feature or <code>false</code> to disable the feature.
  416. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  417. */
  418. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetHDRModeEnabled(VzDeviceHandle device, bool bEnabled);
  419. /**
  420. * @brief Returns the Boolean value of whether the HDRMode of ToF sensor feature is enabled or disabled.
  421. * @param[in] device The handle of the device on which to enable or disable the feature.
  422. * @param[in] bEnabled Set to <code>true</code> to enable the feature or <code>false</code> to disable the feature.
  423. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  424. */
  425. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetHDRModeEnabled(VzDeviceHandle device, bool *bEnabled);
  426. /**
  427. * @brief Set the input signal parameters for Hardware Trigger.
  428. * @param[in] device The handle of the device
  429. * @param[in] params Pointer to a variable in which to store the parameters.
  430. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  431. */
  432. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetInputSignalParamsForHWTrigger(VzDeviceHandle device, VzInputSignalParamsForHWTrigger params);
  433. /**
  434. * @brief Get the Input signal parameters for Hardware Trigger.
  435. * @param[in] device The handle of the device
  436. * @param[out] pParams Pointer to a variable in which to store the returned value.
  437. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  438. */
  439. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetInputSignalParamsForHWTrigger(VzDeviceHandle device, VzInputSignalParamsForHWTrigger *pParams);
  440. /**
  441. * @brief Set the output signal parameters.
  442. * @param[in] device The handle of the device
  443. * @param[in] params Pointer to a variable in which to store the parameters.
  444. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  445. */
  446. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetOutputSignalParams(VzDeviceHandle device, VzOutputSignalParams params);
  447. /**
  448. * @brief Get the output signal parameters.
  449. * @param[in] device The handle of the device
  450. * @param[out] pParams Pointer to a variable in which to store the returned value.
  451. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  452. */
  453. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetOutputSignalParams(VzDeviceHandle device, VzOutputSignalParams *pParams);
  454. /**
  455. * @brief Set the parameters by Json file that can be saved by NebulaGUITool.
  456. * @param[in] device The handle of the device.
  457. * @param[in] pfilePath Pointer to the path of Json file.
  458. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  459. */
  460. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetParamsByJson(VzDeviceHandle device, char* pfilePath);
  461. /**
  462. * @brief Set the color Gain with the exposure mode of RGB sensor in VzExposureControlMode_Manual.
  463. * @param[in] device The handle of the device.
  464. * @param[in] params The value of color Gain.Value range: [1.0 15.5]
  465. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  466. */
  467. VZENSE_C_API_EXPORT VzReturnStatus VZ_SetColorGain(VzDeviceHandle device, float params);
  468. /**
  469. * @brief Get the color Gain.
  470. * @param[in] device The handle of the device.
  471. * @param[out] params The value of color Gain.
  472. * @return ::VzRetOK if the function succeeded, or one of the error values defined by ::VzReturnStatus.
  473. */
  474. VZENSE_C_API_EXPORT VzReturnStatus VZ_GetColorGain(VzDeviceHandle device, float *pParams);
  475. #endif /* VZENSEDS_API_H */