IMVApi.h 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  1. /// \mainpage
  2. /// \~chinese
  3. /// \htmlinclude mainpage_chs.html
  4. /// \~english
  5. /// \htmlinclude mainpage_eng.html
  6. #ifndef __IMV_API_H__
  7. #define __IMV_API_H__
  8. #include "IMVDefines.h"
  9. /// \~chinese
  10. /// \brief 动态库导入导出定义
  11. /// \~english
  12. /// \brief Dynamic library import and export definition
  13. #if (defined (_WIN32) || defined(WIN64))
  14. #ifdef IMV_API_DLL_BUILD
  15. #define IMV_API _declspec(dllexport)
  16. #else
  17. #define IMV_API _declspec(dllimport)
  18. #endif
  19. #define IMV_CALL __stdcall
  20. #else
  21. #define IMV_API
  22. #define IMV_CALL
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /// \~chinese
  28. /// \brief 获取版本信息
  29. /// \return 成功时返回版本信息,失败时返回NULL
  30. /// \~english
  31. /// \brief get version information
  32. /// \return Success, return version info. Failure, return NULL
  33. IMV_API const char* IMV_CALL IMV_GetVersion(void);
  34. /// \~chinese
  35. /// \brief 枚举设备
  36. /// \param pDeviceList [OUT] 设备列表
  37. /// \param interfaceType [IN] 待枚举的接口类型, 类型可任意组合,如 interfaceTypeGige | interfaceTypeUsb3
  38. /// \return 成功,返回IMV_OK;错误,返回错误码
  39. /// \remarks
  40. /// 1、当interfaceType = interfaceTypeAll 时,枚举所有接口下的在线设备\n
  41. /// 2、当interfaceType = interfaceTypeGige 时,枚举所有GigE网口下的在线设备\n
  42. /// 3、当interfaceType = interfaceTypeUsb3 时,枚举所有USB接口下的在线设备\n
  43. /// 4、当interfaceType = interfaceTypeCL 时,枚举所有CameraLink接口下的在线设备\n
  44. /// 5、该接口下的interfaceType支持任意接口类型的组合,如,若枚举所有GigE网口和USB3接口下的在线设备时,
  45. /// 可将interfaceType设置为 interfaceType = interfaceTypeGige | interfaceTypeUsb3,其它接口类型组合以此类推
  46. /// \~english
  47. /// \brief Enumerate Device
  48. /// \param pDeviceList [OUT] Device list
  49. /// \param interfaceType [IN] The interface type you want to find, support any interface type combination, sucn as interfaceTypeGige | interfaceTypeUsb3
  50. /// \return Success, return IMV_OK. Failure, return error code
  51. /// \remarks
  52. /// 1、when interfaceType = interfaceTypeAll, enumerate devices in all interface types\n
  53. /// 2、when interfaceType = interfaceTypeGige, enumerate devices in GigE interface \n
  54. /// 3、when interfaceType = interfaceTypeUsb3, enumerate devices in USB interface\n
  55. /// 4、when interfaceType = interfaceTypeCL, enumerate devices in CameraLink interface\n
  56. /// 5、interfaceType supports any interface type combination. For example, if you want to find all GigE and USB3 devices,
  57. /// you can set interfaceType as interfaceType = interfaceTypeGige | interfaceTypeUsb3.
  58. IMV_API int IMV_CALL IMV_EnumDevices(OUT IMV_DeviceList *pDeviceList, IN unsigned int interfaceType);
  59. /// \~chinese
  60. /// \brief 以单播形式枚举设备, 仅限Gige设备使用
  61. /// \param pDeviceList [OUT] 设备列表
  62. /// \param pIpAddress [IN] 设备的IP地址
  63. /// \return 成功,返回IMV_OK;错误,返回错误码
  64. /// \~english
  65. /// \brief Enumerate device by unicast mode. Only for Gige device.
  66. /// \param pDeviceList [OUT] Device list
  67. /// \param pIpAddress [IN] IP address of the device
  68. /// \return Success, return IMV_OK. Failure, return error code
  69. IMV_API int IMV_CALL IMV_EnumDevicesByUnicast(OUT IMV_DeviceList *pDeviceList, IN const char* pIpAddress);
  70. /// \~chinese
  71. /// \brief 通过指定标示符创建设备句柄,如指定索引、设备键、设备自定义名、IP地址
  72. /// \param handle [OUT] 设备句柄
  73. /// \param mode [IN] 创建设备方式
  74. /// \param pIdentifier [IN] 指定标示符(设备键、设备自定义名、IP地址为char类型指针强转void类型指针,索引为unsigned int类型指针强转void类型指针)
  75. /// \return 成功,返回IMV_OK;错误,返回错误码
  76. /// \~english
  77. /// \brief Create device handle by specifying identifiers, such as specifying index, device key, device userID, and IP address
  78. /// \param handle [OUT] Device handle
  79. /// \param mode [IN] Create handle mode
  80. /// \param pIdentifier [IN] Specifying identifiers(device key, device userID, and IP address is char* forced to void*, index is unsigned int* forced to void*)
  81. /// \return Success, return IMV_OK. Failure, return error code
  82. IMV_API int IMV_CALL IMV_CreateHandle(OUT IMV_HANDLE* handle, IN IMV_ECreateHandleMode mode, IN void* pIdentifier);
  83. /// \~chinese
  84. /// \brief 销毁设备句柄
  85. /// \param handle [IN] 设备句柄
  86. /// \return 成功,返回IMV_OK;错误,返回错误码
  87. /// \~english
  88. /// \brief Destroy device handle
  89. /// \param handle [IN] Device handle
  90. /// \return Success, return IMV_OK. Failure, return error code
  91. IMV_API int IMV_CALL IMV_DestroyHandle(IN IMV_HANDLE handle);
  92. /// \~chinese
  93. /// \brief 获取设备信息
  94. /// \param handle [IN] 设备句柄
  95. /// \param pDevInfo [OUT] 设备信息
  96. /// \return 成功,返回IMV_OK;错误,返回错误码
  97. /// \~english
  98. /// \brief Get device information
  99. /// \param handle [IN] Device handle
  100. /// \param pDevInfo [OUT] Device information
  101. /// \return Success, return IMV_OK. Failure, return error code
  102. IMV_API int IMV_CALL IMV_GetDeviceInfo(IN IMV_HANDLE handle, OUT IMV_DeviceInfo *pDevInfo);
  103. /// \~chinese
  104. /// \brief 打开设备
  105. /// \param handle [IN] 设备句柄
  106. /// \return 成功,返回IMV_OK;错误,返回错误码
  107. /// \~english
  108. /// \brief Open Device
  109. /// \param handle [IN] Device handle
  110. /// \return Success, return IMV_OK. Failure, return error code
  111. IMV_API int IMV_CALL IMV_Open(IN IMV_HANDLE handle);
  112. /// \~chinese
  113. /// \brief 打开设备
  114. /// \param handle [IN] 设备句柄
  115. /// \param accessPermission [IN] 控制通道权限(IMV_Open默认使用accessPermissionControl权限)
  116. /// \return 成功,返回IMV_OK;错误,返回错误码
  117. /// \~english
  118. /// \brief Open Device
  119. /// \param handle [IN] Device handle
  120. /// \param accessPermission [IN] Control access permission(Default used accessPermissionControl in IMV_Open)
  121. /// \return Success, return IMV_OK. Failure, return error code
  122. IMV_API int IMV_CALL IMV_OpenEx(IN IMV_HANDLE handle, IN IMV_ECameraAccessPermission accessPermission);
  123. /// \~chinese
  124. /// \brief 判断设备是否已打开
  125. /// \param handle [IN] 设备句柄
  126. /// \return 打开状态,返回true;关闭状态或者掉线状态,返回false
  127. /// \~english
  128. /// \brief Check whether device is opened or not
  129. /// \param handle [IN] Device handle
  130. /// \return Opened, return true. Closed or Offline, return false
  131. IMV_API bool IMV_CALL IMV_IsOpen(IN IMV_HANDLE handle);
  132. /// \~chinese
  133. /// \brief 关闭设备
  134. /// \param handle [IN] 设备句柄
  135. /// \return 成功,返回IMV_OK;错误,返回错误码
  136. /// \~english
  137. /// \brief Close Device
  138. /// \param handle [IN] Device handle
  139. /// \return Success, return IMV_OK. Failure, return error code
  140. IMV_API int IMV_CALL IMV_Close(IN IMV_HANDLE handle);
  141. /// \~chinese
  142. /// \brief 修改设备IP, 仅限Gige设备使用
  143. /// \param handle [IN] 设备句柄
  144. /// \param pIpAddress [IN] IP地址
  145. /// \param pSubnetMask [IN] 子网掩码
  146. /// \param pGateway [IN] 默认网关
  147. /// \return 成功,返回IMV_OK;错误,返回错误码
  148. /// \remarks
  149. /// 1、调用该函数时如果pSubnetMask和pGateway都设置了有效值,则以此有效值为准;\n
  150. /// 2、调用该函数时如果pSubnetMask和pGateway都设置了NULL,则内部实现时用它所连接网卡的子网掩码和网关代替\n
  151. /// 3、调用该函数时如果pSubnetMask和pGateway两者中其中一个为NULL,另一个非NULL,则返回错误
  152. /// \~english
  153. /// \brief Modify device IP. Only for Gige device.
  154. /// \param handle [IN] Device handle
  155. /// \param pIpAddress [IN] IP address
  156. /// \param pSubnetMask [IN] SubnetMask
  157. /// \param pGateway [IN] Gateway
  158. /// \return Success, return IMV_OK. Failure, return error code
  159. /// \remarks
  160. /// 1、When callback this function, if the values of pSubnetMask and pGateway are both valid then we consider the value is correct\n
  161. /// 2、When callback this function, if the values of pSubnetMask and pGateway are both NULL,
  162. /// then these values will be replaced by the subnetmask and gateway of NIC which this device connect to.\n
  163. /// 3、When callback this function, if there is one value of pSubnetMask or pGateway is NULL and the other one is not NULL, then return error
  164. IMV_API int IMV_CALL IMV_GIGE_ForceIpAddress(IN IMV_HANDLE handle, IN const char* pIpAddress, IN const char* pSubnetMask, IN const char* pGateway);
  165. /// \~chinese
  166. /// \brief 获取设备的当前访问权限, 仅限Gige设备使用
  167. /// \param handle [IN] 设备句柄
  168. /// \param pAccessPermission [OUT] 设备的当前访问权限
  169. /// \return 成功,返回IMV_OK;错误,返回错误码
  170. /// \~english
  171. /// \brief Get current access permission of device. Only for Gige device.
  172. /// \param handle [IN] Device handle
  173. /// \param pAccessPermission [OUT] Current access permission of device
  174. /// \return Success, return IMV_OK. Failure, return error code
  175. IMV_API int IMV_CALL IMV_GIGE_GetAccessPermission(IN IMV_HANDLE handle, OUT IMV_ECameraAccessPermission* pAccessPermission);
  176. /// \~chinese
  177. /// \brief 设置设备对sdk命令的响应超时时间,仅限Gige设备使用
  178. /// \param handle [IN] 设备句柄
  179. /// \param timeout [IN] 超时时间,单位ms
  180. /// \return 成功,返回IMV_OK;错误,返回错误码
  181. /// \~english
  182. /// \brief Set the response timeout interval of device sends command to the API. Only for Gige device.
  183. /// \param handle [IN] Device handle
  184. /// \param timeout [IN] time out, unit:ms
  185. /// \return Success, return IMV_OK. Failure, return error code
  186. IMV_API int IMV_CALL IMV_GIGE_SetAnswerTimeout(IN IMV_HANDLE handle, IN unsigned int timeout);
  187. /// \~chinese
  188. /// \brief 下载设备描述XML文件,并保存到指定路径,如:D:\\xml.zip
  189. /// \param handle [IN] 设备句柄
  190. /// \param pFullFileName [IN] 文件要保存的路径
  191. /// \return 成功,返回IMV_OK;错误,返回错误码
  192. /// \~english
  193. /// \brief Download device description XML file, and save the files to specified path. e.g. D:\\xml.zip
  194. /// \param handle [IN] Device handle
  195. /// \param pFullFileName [IN] The full paths where the downloaded XMl files would be saved to
  196. /// \return Success, return IMV_OK. Failure, return error code
  197. IMV_API int IMV_CALL IMV_DownLoadGenICamXML(IN IMV_HANDLE handle, IN const char* pFullFileName);
  198. /// \~chinese
  199. /// \brief 保存设备配置到指定的位置。同名文件已存在时,覆盖。
  200. /// \param handle [IN] 设备句柄
  201. /// \param pFullFileName [IN] 导出的设备配置文件全名(含路径),如:D:\\config.xml 或 D:\\config.mvcfg
  202. /// \return 成功,返回IMV_OK;错误,返回错误码
  203. /// \~english
  204. /// \brief Save the configuration of the device. Overwrite the file if exists.
  205. /// \param handle [IN] Device handle
  206. /// \param pFullFileName [IN] The full path name of the property file(xml). e.g. D:\\config.xml or D:\\config.mvcfg
  207. /// \return Success, return IMV_OK. Failure, return error code
  208. IMV_API int IMV_CALL IMV_SaveDeviceCfg(IN IMV_HANDLE handle, IN const char* pFullFileName);
  209. /// \~chinese
  210. /// \brief 从文件加载设备xml配置
  211. /// \param handle [IN] 设备句柄
  212. /// \param pFullFileName [IN] 设备配置(xml)文件全名(含路径),如:D:\\config.xml 或 D:\\config.mvcfg
  213. /// \param pErrorList [OUT] 加载失败的属性名列表。存放加载失败的属性上限为IMV_MAX_ERROR_LIST_NUM。
  214. /// \return 成功,返回IMV_OK;错误,返回错误码
  215. /// \~english
  216. /// \brief load the configuration of the device
  217. /// \param handle [IN] Device handle
  218. /// \param pFullFileName [IN] The full path name of the property file(xml). e.g. D:\\config.xml or D:\\config.mvcfg
  219. /// \param pErrorList [OUT] The list of load failed properties. The failed to load properties list up to IMV_MAX_ERROR_LIST_NUM.
  220. /// \return Success, return IMV_OK. Failure, return error code
  221. IMV_API int IMV_CALL IMV_LoadDeviceCfg(IN IMV_HANDLE handle, IN const char* pFullFileName, OUT IMV_ErrorList* pErrorList);
  222. /// \~chinese
  223. /// \brief 写用户自定义数据。相机内部保留32768字节用于用户存储自定义数据(此功能针对本品牌相机,其它品牌相机无此功能)
  224. /// \param handle [IN] 设备句柄
  225. /// \param pBuffer [IN] 数据缓冲的指针
  226. /// \param pLength [IN] 期望写入的字节数 [OUT] 实际写入的字节数
  227. /// \return 成功,返回IMV_OK;错误,返回错误码
  228. /// \~english
  229. /// \brief Write user-defined data; Inside the camera, there are 32768 bytes reserved for user to store private data (Only for our own camera has this function)
  230. /// \param handle [IN] Device handle
  231. /// \param pBuffer [IN] Pointer of the data buffer
  232. /// \param pLength [IN] Byte count written expected [OUT] Byte count written in fact
  233. /// \return Success, return IMV_OK. Failure, return error code
  234. IMV_API int IMV_CALL IMV_WriteUserPrivateData(IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength);
  235. /// \~chinese
  236. /// \brief 读用户自定义数据。相机内部保留32768字节用于用户存储自定义数据(此功能针对本品牌相机,其它品牌相机无此功能)
  237. /// \param handle [IN] 设备句柄
  238. /// \param pBuffer [OUT] 数据缓冲的指针
  239. /// \param pLength [IN] 期望读出的字节数 [OUT] 实际读出的字节数
  240. /// \return 成功,返回IMV_OK;错误,返回错误码
  241. /// \~english
  242. /// \brief Read user-defined data; Inside the camera, there are 32768 bytes reserved for user to store private data (Only for our own camera has this function)
  243. /// \param handle [IN] Device handle
  244. /// \param pBuffer [OUT] Pointer of the data buffer
  245. /// \param pLength [IN] Byte count read expected [OUT] Byte count read in fact
  246. /// \return Success, return IMV_OK. Failure, return error code
  247. IMV_API int IMV_CALL IMV_ReadUserPrivateData(IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength);
  248. /// \~chinese
  249. /// \brief 往相机串口寄存器写数据,每次写会清除掉上次的数据(此功能只支持包含串口功能的本品牌相机)
  250. /// \param handle [IN] 设备句柄
  251. /// \param pBuffer [IN] 数据缓冲的指针
  252. /// \param pLength [IN] 期望写入的字节数 [OUT] 实际写入的字节数
  253. /// \return 成功,返回IMV_OK;错误,返回错误码
  254. /// \~english
  255. /// \brief Write serial data to camera serial register, will erase the data writen before (Only for our own camera with serial port has this function)
  256. /// \param handle [IN] Device handle
  257. /// \param pBuffer [IN] Pointer of the data buffer
  258. /// \param pLength [IN] Byte count written expected [OUT] Byte count written in fact
  259. /// \return Success, return IMV_OK. Failure, return error code
  260. IMV_API int IMV_CALL IMV_WriteUARTData(IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength);
  261. /// \~chinese
  262. /// \brief 从相机串口寄存器读取串口数据(此功能只支持包含串口功能的本品牌相机 )
  263. /// \param handle [IN] 设备句柄
  264. /// \param pBuffer [OUT] 数据缓冲的指针
  265. /// \param pLength [IN] 期望读出的字节数 [OUT] 实际读出的字节数
  266. /// \return 成功,返回IMV_OK;错误,返回错误码
  267. /// \~english
  268. /// \brief Read serial data from camera serial register (Only for our own camera with serial port has this function)
  269. /// \param handle [IN] Device handle
  270. /// \param pBuffer [OUT] Pointer of the data buffer
  271. /// \param pLength [IN] Byte count read expected [OUT] Byte count read in fact
  272. /// \return Success, return IMV_OK. Failure, return error code
  273. IMV_API int IMV_CALL IMV_ReadUARTData(IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength);
  274. /// \~chinese
  275. /// \brief 设备连接状态事件回调注册
  276. /// \param handle [IN] 设备句柄
  277. /// \param proc [IN] 设备连接状态事件回调函数
  278. /// \param pUser [IN] 用户自定义数据, 可设为NULL
  279. /// \return 成功,返回IMV_OK;错误,返回错误码
  280. /// \remarks
  281. /// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册
  282. /// \~english
  283. /// \brief Register call back function of device connection status event.
  284. /// \param handle [IN] Device handle
  285. /// \param proc [IN] Call back function of device connection status event
  286. /// \param pUser [IN] User defined data,It can be set to NULL
  287. /// \return Success, return IMV_OK. Failure, return error code
  288. /// \remarks
  289. /// Only one call back function is supported.\n
  290. /// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened
  291. IMV_API int IMV_CALL IMV_SubscribeConnectArg(IN IMV_HANDLE handle, IN IMV_ConnectCallBack proc, IN void* pUser);
  292. /// \~chinese
  293. /// \brief 参数更新事件回调注册
  294. /// \param handle [IN] 设备句柄
  295. /// \param proc [IN] 参数更新注册的事件回调函数
  296. /// \param pUser [IN] 用户自定义数据, 可设为NULL
  297. /// \return 成功,返回IMV_OK;错误,返回错误码
  298. /// \remarks
  299. /// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册
  300. /// \~english
  301. /// \brief Register call back function of parameter update event.
  302. /// \param handle [IN] Device handle
  303. /// \param proc [IN] Call back function of parameter update event
  304. /// \param pUser [IN] User defined data,It can be set to NULL
  305. /// \return Success, return IMV_OK. Failure, return error code
  306. /// \remarks
  307. /// Only one call back function is supported.\n
  308. /// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened
  309. IMV_API int IMV_CALL IMV_SubscribeParamUpdateArg(IN IMV_HANDLE handle, IN IMV_ParamUpdateCallBack proc, IN void* pUser);
  310. /// \~chinese
  311. /// \brief 流通道事件回调注册
  312. /// \param handle [IN] 设备句柄
  313. /// \param proc [IN] 流通道事件回调注册函数
  314. /// \param pUser [IN] 用户自定义数据, 可设为NULL
  315. /// \return 成功,返回IMV_OK;错误,返回错误码
  316. /// \remarks
  317. /// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册
  318. /// \~english
  319. /// \brief Register call back function of stream channel event.
  320. /// \param handle [IN] Device handle
  321. /// \param proc [IN] Call back function of stream channel event
  322. /// \param pUser [IN] User defined data,It can be set to NULL
  323. /// \return Success, return IMV_OK. Failure, return error code
  324. /// \remarks
  325. /// Only one call back function is supported.\n
  326. /// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened
  327. IMV_API int IMV_CALL IMV_SubscribeStreamArg(IN IMV_HANDLE handle, IN IMV_StreamCallBack proc, IN void* pUser);
  328. /// \~chinese
  329. /// \brief 消息通道事件回调注册
  330. /// \param handle [IN] 设备句柄
  331. /// \param proc [IN] 消息通道事件回调注册函数
  332. /// \param pUser [IN] 用户自定义数据, 可设为NULL
  333. /// \return 成功,返回IMV_OK;错误,返回错误码
  334. /// \remarks
  335. /// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册
  336. /// \~english
  337. /// \brief Register call back function of message channel event.
  338. /// \param handle [IN] Device handle
  339. /// \param proc [IN] Call back function of message channel event
  340. /// \param pUser [IN] User defined data,It can be set to NULL
  341. /// \return Success, return IMV_OK. Failure, return error code
  342. /// \remarks
  343. /// Only one call back function is supported.\n
  344. /// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened
  345. IMV_API int IMV_CALL IMV_SubscribeMsgChannelArg(IN IMV_HANDLE handle, IN IMV_MsgChannelCallBack proc, IN void* pUser);
  346. /// \~chinese
  347. /// \brief 设置帧数据缓存个数
  348. /// \param handle [IN] 设备句柄
  349. /// \param nSize [IN] 缓存数量
  350. /// \return 成功,返回IMV_OK;错误,返回错误码
  351. /// \remarks
  352. /// 不能在拉流过程中设置
  353. /// \~english
  354. /// \brief Set frame buffer count
  355. /// \param handle [IN] Device handle
  356. /// \param nSize [IN] The buffer count
  357. /// \return Success, return IMV_OK. Failure, return error code
  358. /// \remarks
  359. /// It can not be set during frame grabbing
  360. IMV_API int IMV_CALL IMV_SetBufferCount(IN IMV_HANDLE handle, IN unsigned int nSize);
  361. /// \~chinese
  362. /// \brief 清除帧数据缓存
  363. /// \param handle [IN] 设备句柄
  364. /// \return 成功,返回IMV_OK;错误,返回错误码
  365. /// \~english
  366. /// \brief Clear frame buffer
  367. /// \param handle [IN] Device handle
  368. /// \return Success, return IMV_OK. Failure, return error code
  369. IMV_API int IMV_CALL IMV_ClearFrameBuffer(IN IMV_HANDLE handle);
  370. /// \~chinese
  371. /// \brief 设置驱动包间隔时间(MS),仅对Gige设备有效
  372. /// \param handle [IN] 设备句柄
  373. /// \param nTimeout [IN] 包间隔时间,单位是毫秒
  374. /// \return 成功,返回IMV_OK;错误,返回错误码
  375. /// \remarks
  376. /// 触发模式尾包丢失重传机制
  377. /// \~english
  378. /// \brief Set packet timeout(MS), only for Gige device
  379. /// \param handle [IN] Device handle
  380. /// \param nTimeout [IN] Time out value, unit is MS
  381. /// \return Success, return IMV_OK. Failure, return error code
  382. /// \remarks
  383. /// The resend mechanism of tail packet loss on trigger mode
  384. IMV_API int IMV_CALL IMV_GIGE_SetInterPacketTimeout(IN IMV_HANDLE handle, IN unsigned int nTimeout);
  385. /// \~chinese
  386. /// \brief 设置单次重传最大包个数, 仅对GigE设备有效
  387. /// \param handle [IN] 设备句柄
  388. /// \param maxPacketNum [IN] 单次重传最大包个数
  389. /// \return 成功,返回IMV_OK;错误,返回错误码
  390. /// \remarks
  391. /// maxPacketNum为0时,该功能无效
  392. /// \~english
  393. /// \brief Set the single resend maximum packet number, only for Gige device
  394. /// \param handle [IN] Device handle
  395. /// \param maxPacketNum [IN] The value of single resend maximum packet number
  396. /// \return Success, return IMV_OK. Failure, return error code
  397. /// \remarks
  398. /// Disable the function when maxPacketNum is 0
  399. IMV_API int IMV_CALL IMV_GIGE_SetSingleResendMaxPacketNum(IN IMV_HANDLE handle, IN unsigned int maxPacketNum);
  400. /// \~chinese
  401. /// \brief 设置同一帧最大丢包的数量,仅对GigE设备有效
  402. /// \param handle [IN] 设备句柄
  403. /// \param maxLostPacketNum [IN] 最大丢包的数量
  404. /// \return 成功,返回IMV_OK;错误,返回错误码
  405. /// \remarks
  406. /// maxLostPacketNum为0时,该功能无效
  407. /// \~english
  408. /// \brief Set the maximum lost packet number, only for Gige device
  409. /// \param handle [IN] Device handle
  410. /// \param maxLostPacketNum [IN] The value of maximum lost packet number
  411. /// \return Success, return IMV_OK. Failure, return error code
  412. /// \remarks
  413. /// Disable the function when maxLostPacketNum is 0
  414. IMV_API int IMV_CALL IMV_GIGE_SetMaxLostPacketNum(IN IMV_HANDLE handle, IN unsigned int maxLostPacketNum);
  415. /// \~chinese
  416. /// \brief 设置U3V设备的传输数据块的数量和大小,仅对USB设备有效
  417. /// \param handle [IN] 设备句柄
  418. /// \param nNum [IN] 传输数据块的数量(范围:5-256)
  419. /// \param nSize [IN] 传输数据块的大小(范围:8-512, 单位:KByte)
  420. /// \return 成功,返回IMV_OK;错误,返回错误码
  421. /// \remarks
  422. /// 1、传输数据块数量,范围5 - 256, 默认为64,高分辨率高帧率时可以适当增加该值;多台相机共同使用时,可以适当减小该值\n
  423. /// 2、传输每个数据块大小,范围8 - 512, 默认为64,单位是KByte
  424. /// \~english
  425. /// \brief Set the number and size of urb transmitted, only for USB device
  426. /// \param handle [IN] Device handle
  427. /// \param nNum [IN] The number of urb transmitted(range:5-256)
  428. /// \param nSize [IN] The size of urb transmitted(range:8-512, unit:KByte)
  429. /// \return Success, return IMV_OK. Failure, return error code
  430. /// \remarks
  431. /// 1、The number of urb transmitted, the range is 5 - 256, and the default is 64. when high pixel and high frame rate can be appropriately increased.;
  432. /// when multiple cameras are used together, the value can be appropriately reduced.\n
  433. /// 2、The size of each urb transmitted, the range is 8 - 512, the default is 64, the unit is KByte.
  434. IMV_API int IMV_CALL IMV_USB_SetUrbTransfer(IN IMV_HANDLE handle, IN unsigned int nNum, IN unsigned int nSize);
  435. /// \~chinese
  436. /// \brief 开始取流
  437. /// \param handle [IN] 设备句柄
  438. /// \return 成功,返回IMV_OK;错误,返回错误码
  439. /// \~english
  440. /// \brief Start grabbing
  441. /// \param handle [IN] Device handle
  442. /// \return Success, return IMV_OK. Failure, return error code
  443. IMV_API int IMV_CALL IMV_StartGrabbing(IN IMV_HANDLE handle);
  444. /// \~chinese
  445. /// \brief 开始取流
  446. /// \param handle [IN] 设备句柄
  447. /// \param maxImagesGrabbed [IN] 允许最多的取帧数,达到指定取帧数后停止取流,如果为0,表示忽略此参数连续取流(IMV_StartGrabbing默认0)
  448. /// \param strategy [IN] 取流策略,(IMV_StartGrabbing默认使用grabStrartegySequential策略取流)
  449. /// \return 成功,返回IMV_OK;错误,返回错误码
  450. /// \~english
  451. /// \brief Start grabbing
  452. /// \param handle [IN] Device handle
  453. /// \param maxImagesGrabbed [IN] Maximum images allowed to grab, once it reaches the limit then stop grabbing;
  454. /// If it is 0, then ignore this parameter and start grabbing continuously(default 0 in IMV_StartGrabbing)
  455. /// \param strategy [IN] Image grabbing strategy; (Default grabStrartegySequential in IMV_StartGrabbing)
  456. /// \return Success, return IMV_OK. Failure, return error code
  457. IMV_API int IMV_CALL IMV_StartGrabbingEx(IN IMV_HANDLE handle, IN uint64_t maxImagesGrabbed, IN IMV_EGrabStrategy strategy);
  458. /// \~chinese
  459. /// \brief 判断设备是否正在取流
  460. /// \param handle [IN] 设备句柄
  461. /// \return 正在取流,返回true;不在取流,返回false
  462. /// \~english
  463. /// \brief Check whether device is grabbing or not
  464. /// \param handle [IN] Device handle
  465. /// \return Grabbing, return true. Not grabbing, return false
  466. IMV_API bool IMV_CALL IMV_IsGrabbing(IN IMV_HANDLE handle);
  467. /// \~chinese
  468. /// \brief 停止取流
  469. /// \param handle [IN] 设备句柄
  470. /// \return 成功,返回IMV_OK;错误,返回错误码
  471. /// \~english
  472. /// \brief Stop grabbing
  473. /// \param handle [IN] Device handle
  474. /// \return Success, return IMV_OK. Failure, return error code
  475. IMV_API int IMV_CALL IMV_StopGrabbing(IN IMV_HANDLE handle);
  476. /// \~chinese
  477. /// \brief 注册帧数据回调函数(异步获取帧数据机制)
  478. /// \param handle [IN] 设备句柄
  479. /// \param proc [IN] 帧数据信息回调函数,建议不要在该函数中处理耗时的操作,否则会阻塞后续帧数据的实时性
  480. /// \param pUser [IN] 用户自定义数据, 可设为NULL
  481. /// \return 成功,返回IMV_OK;错误,返回错误码
  482. /// \remarks
  483. /// 该异步获取帧数据机制和同步获取帧数据机制(IMV_GetFrame)互斥,对于同一设备,系统中两者只能选其一\n
  484. /// 只支持一个回调函数, 且设备关闭后,注册会失效,打开设备后需重新注册
  485. /// \~english
  486. /// \brief Register frame data callback function( asynchronous getting frame data mechanism);
  487. /// \param handle [IN] Device handle
  488. /// \param proc [IN] Frame data information callback function; It is advised to not put time-cosuming operation in this function,
  489. /// otherwise it will block follow-up data frames and affect real time performance
  490. /// \param pUser [IN] User defined data,It can be set to NULL
  491. /// \return Success, return IMV_OK. Failure, return error code
  492. /// \remarks
  493. /// This asynchronous getting frame data mechanism and synchronous getting frame data mechanism(IMV_GetFrame) are mutually exclusive,\n
  494. /// only one method can be choosed between these two in system for the same device.\n
  495. /// Only one call back function is supported.\n
  496. /// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened
  497. IMV_API int IMV_CALL IMV_AttachGrabbing(IN IMV_HANDLE handle, IN IMV_FrameCallBack proc, IN void* pUser);
  498. /// \~chinese
  499. /// \brief 获取一帧图像(同步获取帧数据机制)
  500. /// \param handle [IN] 设备句柄
  501. /// \param pFrame [OUT] 帧数据信息
  502. /// \param timeoutMS [IN] 获取一帧图像的超时时间,INFINITE时表示无限等待,直到收到一帧数据或者停止取流。单位是毫秒
  503. /// \return 成功,返回IMV_OK;错误,返回错误码
  504. /// \remarks
  505. /// 该接口不支持多线程调用。\n
  506. /// 该同步获取帧机制和异步获取帧机制(IMV_AttachGrabbing)互斥,对于同一设备,系统中两者只能选其一。\n
  507. /// 使用内部缓存获取图像,需要IMV_ReleaseFrame进行释放图像缓存。
  508. /// \~english
  509. /// \brief Get a frame image(synchronous getting frame data mechanism)
  510. /// \param handle [IN] Device handle
  511. /// \param pFrame [OUT] Frame data information
  512. /// \param timeoutMS [IN] The time out of getting one image, INFINITE means infinite wait until the one frame data is returned or stop grabbing.unit is MS
  513. /// \return Success, return IMV_OK. Failure, return error code
  514. /// \remarks
  515. /// This interface does not support multi-threading.\n
  516. /// This synchronous getting frame data mechanism and asynchronous getting frame data mechanism(IMV_AttachGrabbing) are mutually exclusive,\n
  517. /// only one method can be chose between these two in system for the same device.\n
  518. /// Use internal cache to get image, need to release image buffer by IMV_ReleaseFrame
  519. IMV_API int IMV_CALL IMV_GetFrame(IN IMV_HANDLE handle, OUT IMV_Frame* pFrame, IN unsigned int timeoutMS);
  520. /// \~chinese
  521. /// \brief 释放图像缓存
  522. /// \param handle [IN] 设备句柄
  523. /// \param pFrame [IN] 帧数据信息
  524. /// \return 成功,返回IMV_OK;错误,返回错误码
  525. /// \~english
  526. /// \brief Free image buffer
  527. /// \param handle [IN] Device handle
  528. /// \param pFrame [IN] Frame image data information
  529. /// \return Success, return IMV_OK. Failure, return error code
  530. IMV_API int IMV_CALL IMV_ReleaseFrame(IN IMV_HANDLE handle, IN IMV_Frame* pFrame);
  531. /// \~chinese
  532. /// \brief 帧数据深拷贝克隆
  533. /// \param handle [IN] 设备句柄
  534. /// \param pFrame [IN] 克隆源帧数据信息
  535. /// \param pCloneFrame [OUT] 新的帧数据信息
  536. /// \return 成功,返回IMV_OK;错误,返回错误码
  537. /// \remarks
  538. /// 使用IMV_ReleaseFrame进行释放图像缓存。
  539. /// \~english
  540. /// \brief Frame data deep clone
  541. /// \param handle [IN] Device handle
  542. /// \param pFrame [IN] Frame data information of clone source
  543. /// \param pCloneFrame [OUT] New frame data information
  544. /// \return Success, return IMV_OK. Failure, return error code
  545. /// \remarks
  546. /// Use IMV_ReleaseFrame to free image buffer
  547. IMV_API int IMV_CALL IMV_CloneFrame(IN IMV_HANDLE handle, IN IMV_Frame* pFrame, OUT IMV_Frame* pCloneFrame);
  548. /// \~chinese
  549. /// \brief 获取Chunk数据(仅对GigE/Usb相机有效)
  550. /// \param handle [IN] 设备句柄
  551. /// \param pFrame [IN] 帧数据信息
  552. /// \param index [IN] 索引ID
  553. /// \param pChunkDataInfo [OUT] Chunk数据信息
  554. /// \return 成功,返回IMV_OK;错误,返回错误码
  555. /// \~english
  556. /// \brief Get chunk data(Only GigE/Usb Camera)
  557. /// \param handle [IN] Device handle
  558. /// \param pFrame [IN] Frame data information
  559. /// \param index [IN] index ID
  560. /// \param pChunkDataInfo [OUT] Chunk data infomation
  561. /// \return Success, return IMV_OK. Failure, return error code
  562. IMV_API int IMV_CALL IMV_GetChunkDataByIndex(IN IMV_HANDLE handle, IN IMV_Frame* pFrame, IN unsigned int index, OUT IMV_ChunkDataInfo *pChunkDataInfo);
  563. /// \~chinese
  564. /// \brief 获取流统计信息(IMV_StartGrabbing / IMV_StartGrabbing执行后调用)
  565. /// \param handle [IN] 设备句柄
  566. /// \param pStreamStatsInfo [OUT] 流统计信息数据
  567. /// \return 成功,返回IMV_OK;错误,返回错误码
  568. /// \~english
  569. /// \brief Get stream statistics infomation(Used after excuting IMV_StartGrabbing / IMV_StartGrabbing)
  570. /// \param handle [IN] Device handle
  571. /// \param pStreamStatsInfo [OUT] Stream statistics infomation
  572. /// \return Success, return IMV_OK. Failure, return error code
  573. IMV_API int IMV_CALL IMV_GetStatisticsInfo(IN IMV_HANDLE handle, OUT IMV_StreamStatisticsInfo* pStreamStatsInfo);
  574. /// \~chinese
  575. /// \brief 重置流统计信息(IMV_StartGrabbing / IMV_StartGrabbing执行后调用)
  576. /// \param handle [IN] 设备句柄
  577. /// \return 成功,返回IMV_OK;错误,返回错误码
  578. /// \~english
  579. /// \brief Reset stream statistics infomation(Used after excuting IMV_StartGrabbing / IMV_StartGrabbing)
  580. /// \param handle [IN] Device handle
  581. /// \return Success, return IMV_OK. Failure, return error code
  582. IMV_API int IMV_CALL IMV_ResetStatisticsInfo(IN IMV_HANDLE handle);
  583. /// \~chinese
  584. /// \brief 判断属性是否可用
  585. /// \param handle [IN] 设备句柄
  586. /// \param pFeatureName [IN] 属性名
  587. /// \return 可用,返回true;不可用,返回false
  588. /// \~english
  589. /// \brief Check the property is available or not
  590. /// \param handle [IN] Device handle
  591. /// \param pFeatureName [IN] Feature name
  592. /// \return Available, return true. Not available, return false
  593. IMV_API bool IMV_CALL IMV_FeatureIsAvailable(IN IMV_HANDLE handle, IN const char* pFeatureName);
  594. /// \~chinese
  595. /// \brief 判断属性是否可读
  596. /// \param handle [IN] 设备句柄
  597. /// \param pFeatureName [IN] 属性名
  598. /// \return 可读,返回true;不可读,返回false
  599. /// \~english
  600. /// \brief Check the property is readable or not
  601. /// \param handle [IN] Device handle
  602. /// \param pFeatureName [IN] Feature name
  603. /// \return Readable, return true. Not readable, return false
  604. IMV_API bool IMV_CALL IMV_FeatureIsReadable(IN IMV_HANDLE handle, IN const char* pFeatureName);
  605. /// \~chinese
  606. /// \brief 判断属性是否可写
  607. /// \param handle [IN] 设备句柄
  608. /// \param pFeatureName [IN] 属性名
  609. /// \return 可写,返回true;不可写,返回false
  610. /// \~english
  611. /// \brief Check the property is writeable or not
  612. /// \param handle [IN] Device handle
  613. /// \param pFeatureName [IN] Feature name
  614. /// \return Writeable, return true. Not writeable, return false
  615. IMV_API bool IMV_CALL IMV_FeatureIsWriteable(IN IMV_HANDLE handle, IN const char* pFeatureName);
  616. /// \~chinese
  617. /// \brief 判断属性是否可流
  618. /// \param handle [IN] 设备句柄
  619. /// \param pFeatureName [IN] 属性名
  620. /// \return 可流,返回true;不可流,返回false
  621. /// \~english
  622. /// \brief Check the property is streamable or not
  623. /// \param handle [IN] Device handle
  624. /// \param pFeatureName [IN] Feature name
  625. /// \return Streamable, return true. Not streamable, return false
  626. IMV_API bool IMV_CALL IMV_FeatureIsStreamable(IN IMV_HANDLE handle, IN const char* pFeatureName);
  627. /// \~chinese
  628. /// \brief 判断属性是否有效
  629. /// \param handle [IN] 设备句柄
  630. /// \param pFeatureName [IN] 属性名
  631. /// \return 有效,返回true;无效,返回false
  632. /// \~english
  633. /// \brief Check the property is valid or not
  634. /// \param handle [IN] Device handle
  635. /// \param pFeatureName [IN] Feature name
  636. /// \return Valid, return true. Invalid, return false
  637. IMV_API bool IMV_CALL IMV_FeatureIsValid(IN IMV_HANDLE handle, IN const char* pFeatureName);
  638. /// \~chinese
  639. /// \brief 获取属性类型
  640. /// \param handle [IN] 设备句柄
  641. /// \param pFeatureName [IN] 属性名
  642. /// \param pPropertyType [OUT] 属性类型
  643. /// \return 获取成功,返回true;获取失败,返回false
  644. /// \~english
  645. /// \brief get property type
  646. /// \param handle [IN] Device handle
  647. /// \param pFeatureName [IN] Feature name
  648. /// \return get success, return true. get failed, return false
  649. IMV_API bool IMV_CALL IMV_GetFeatureType(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_EFeatureType* pPropertyType);
  650. /// \~chinese
  651. /// \brief 获取整型属性值
  652. /// \param handle [IN] 设备句柄
  653. /// \param pFeatureName [IN] 属性名
  654. /// \param pIntValue [OUT] 整型属性值
  655. /// \return 成功,返回IMV_OK;错误,返回错误码
  656. /// \~english
  657. /// \brief Get integer property value
  658. /// \param handle [IN] Device handle
  659. /// \param pFeatureName [IN] Feature name
  660. /// \param pIntValue [OUT] Integer property value
  661. /// \return Success, return IMV_OK. Failure, return error code
  662. IMV_API int IMV_CALL IMV_GetIntFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue);
  663. /// \~chinese
  664. /// \brief 获取整型属性可设的最小值
  665. /// \param handle [IN] 设备句柄
  666. /// \param pFeatureName [IN] 属性名
  667. /// \param pIntValue [OUT] 整型属性可设的最小值
  668. /// \return 成功,返回IMV_OK;错误,返回错误码
  669. /// \~english
  670. /// \brief Get the integer property settable minimum value
  671. /// \param handle [IN] Device handle
  672. /// \param pFeatureName [IN] Feature name
  673. /// \param pIntValue [OUT] Integer property settable minimum value
  674. /// \return Success, return IMV_OK. Failure, return error code
  675. IMV_API int IMV_CALL IMV_GetIntFeatureMin(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue);
  676. /// \~chinese
  677. /// \brief 获取整型属性可设的最大值
  678. /// \param handle [IN] 设备句柄
  679. /// \param pFeatureName [IN] 属性名
  680. /// \param pIntValue [OUT] 整型属性可设的最大值
  681. /// \return 成功,返回IMV_OK;错误,返回错误码
  682. /// \~english
  683. /// \brief Get the integer property settable maximum value
  684. /// \param handle [IN] Device handle
  685. /// \param pFeatureName [IN] Feature name
  686. /// \param pIntValue [OUT] Integer property settable maximum value
  687. /// \return Success, return IMV_OK. Failure, return error code
  688. IMV_API int IMV_CALL IMV_GetIntFeatureMax(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue);
  689. /// \~chinese
  690. /// \brief 获取整型属性步长
  691. /// \param handle [IN] 设备句柄
  692. /// \param pFeatureName [IN] 属性名
  693. /// \param pIntValue [OUT] 整型属性步长
  694. /// \return 成功,返回IMV_OK;错误,返回错误码
  695. /// \~english
  696. /// \brief Get integer property increment
  697. /// \param handle [IN] Device handle
  698. /// \param pFeatureName [IN] Feature name
  699. /// \param pIntValue [OUT] Integer property increment
  700. /// \return Success, return IMV_OK. Failure, return error code
  701. IMV_API int IMV_CALL IMV_GetIntFeatureInc(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue);
  702. /// \~chinese
  703. /// \brief 设置整型属性值
  704. /// \param handle [IN] 设备句柄
  705. /// \param pFeatureName [IN] 属性名
  706. /// \param intValue [IN] 待设置的整型属性值
  707. /// \return 成功,返回IMV_OK;错误,返回错误码
  708. /// \~english
  709. /// \brief Set integer property value
  710. /// \param handle [IN] Device handle
  711. /// \param pFeatureName [IN] Feature name
  712. /// \param intValue [IN] Integer property value to be set
  713. /// \return Success, return IMV_OK. Failure, return error code
  714. IMV_API int IMV_CALL IMV_SetIntFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN int64_t intValue);
  715. /// \~chinese
  716. /// \brief 获取浮点属性值
  717. /// \param handle [IN] 设备句柄
  718. /// \param pFeatureName [IN] 属性名
  719. /// \param pDoubleValue [OUT] 浮点属性值
  720. /// \return 成功,返回IMV_OK;错误,返回错误码
  721. /// \~english
  722. /// \brief Get double property value
  723. /// \param handle [IN] Device handle
  724. /// \param pFeatureName [IN] Feature name
  725. /// \param pDoubleValue [OUT] Double property value
  726. /// \return Success, return IMV_OK. Failure, return error code
  727. IMV_API int IMV_CALL IMV_GetDoubleFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue);
  728. /// \~chinese
  729. /// \brief 获取浮点属性可设的最小值
  730. /// \param handle [IN] 设备句柄
  731. /// \param pFeatureName [IN] 属性名
  732. /// \param pDoubleValue [OUT] 浮点属性可设的最小值
  733. /// \return 成功,返回IMV_OK;错误,返回错误码
  734. /// \~english
  735. /// \brief Get the double property settable minimum value
  736. /// \param handle [IN] Device handle
  737. /// \param pFeatureName [IN] Feature name
  738. /// \param pDoubleValue [OUT] Double property settable minimum value
  739. /// \return Success, return IMV_OK. Failure, return error code
  740. IMV_API int IMV_CALL IMV_GetDoubleFeatureMin(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue);
  741. /// \~chinese
  742. /// \brief 获取浮点属性可设的最大值
  743. /// \param handle [IN] 设备句柄
  744. /// \param pFeatureName [IN] 属性名
  745. /// \param pDoubleValue [OUT] 浮点属性可设的最大值
  746. /// \return 成功,返回IMV_OK;错误,返回错误码
  747. /// \~english
  748. /// \brief Get the double property settable maximum value
  749. /// \param handle [IN] Device handle
  750. /// \param pFeatureName [IN] Feature name
  751. /// \param pDoubleValue [OUT] Double property settable maximum value
  752. /// \return Success, return IMV_OK. Failure, return error code
  753. IMV_API int IMV_CALL IMV_GetDoubleFeatureMax(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue);
  754. /// \~chinese
  755. /// \brief 设置浮点属性值
  756. /// \param handle [IN] 设备句柄
  757. /// \param pFeatureName [IN] 属性名
  758. /// \param doubleValue [IN] 待设置的浮点属性值
  759. /// \return 成功,返回IMV_OK;错误,返回错误码
  760. /// \~english
  761. /// \brief Set double property value
  762. /// \param handle [IN] Device handle
  763. /// \param pFeatureName [IN] Feature name
  764. /// \param doubleValue [IN] Double property value to be set
  765. /// \return Success, return IMV_OK. Failure, return error code
  766. IMV_API int IMV_CALL IMV_SetDoubleFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN double doubleValue);
  767. /// \~chinese
  768. /// \brief 获取布尔属性值
  769. /// \param handle [IN] 设备句柄
  770. /// \param pFeatureName [IN] 属性名
  771. /// \param pBoolValue [OUT] 布尔属性值
  772. /// \return 成功,返回IMV_OK;错误,返回错误码
  773. /// \~english
  774. /// \brief Get boolean property value
  775. /// \param handle [IN] Device handle
  776. /// \param pFeatureName [IN] Feature name
  777. /// \param pBoolValue [OUT] Boolean property value
  778. /// \return Success, return IMV_OK. Failure, return error code
  779. IMV_API int IMV_CALL IMV_GetBoolFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT bool* pBoolValue);
  780. /// \~chinese
  781. /// \brief 设置布尔属性值
  782. /// \param handle [IN] 设备句柄
  783. /// \param pFeatureName [IN] 属性名
  784. /// \param boolValue [IN] 待设置的布尔属性值
  785. /// \return 成功,返回IMV_OK;错误,返回错误码
  786. /// \~english
  787. /// \brief Set boolean property value
  788. /// \param handle [IN] Device handle
  789. /// \param pFeatureName [IN] Feature name
  790. /// \param boolValue [IN] Boolean property value to be set
  791. /// \return Success, return IMV_OK. Failure, return error code
  792. IMV_API int IMV_CALL IMV_SetBoolFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN bool boolValue);
  793. /// \~chinese
  794. /// \brief 获取枚举属性值
  795. /// \param handle [IN] 设备句柄
  796. /// \param pFeatureName [IN] 属性名
  797. /// \param pEnumValue [OUT] 枚举属性值
  798. /// \return 成功,返回IMV_OK;错误,返回错误码
  799. /// \~english
  800. /// \brief Get enumeration property value
  801. /// \param handle [IN] Device handle
  802. /// \param pFeatureName [IN] Feature name
  803. /// \param pEnumValue [OUT] Enumeration property value
  804. /// \return Success, return IMV_OK. Failure, return error code
  805. IMV_API int IMV_CALL IMV_GetEnumFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT uint64_t* pEnumValue);
  806. /// \~chinese
  807. /// \brief 设置枚举属性值
  808. /// \param handle [IN] 设备句柄
  809. /// \param pFeatureName [IN] 属性名
  810. /// \param enumValue [IN] 待设置的枚举属性值
  811. /// \return 成功,返回IMV_OK;错误,返回错误码
  812. /// \~english
  813. /// \brief Set enumeration property value
  814. /// \param handle [IN] Device handle
  815. /// \param pFeatureName [IN] Feature name
  816. /// \param enumValue [IN] Enumeration property value to be set
  817. /// \return Success, return IMV_OK. Failure, return error code
  818. IMV_API int IMV_CALL IMV_SetEnumFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN uint64_t enumValue);
  819. /// \~chinese
  820. /// \brief 获取枚举属性symbol值
  821. /// \param handle [IN] 设备句柄
  822. /// \param pFeatureName [IN] 属性名
  823. /// \param pEnumSymbol [OUT] 枚举属性symbol值
  824. /// \return 成功,返回IMV_OK;错误,返回错误码
  825. /// \~english
  826. /// \brief Get enumeration property symbol value
  827. /// \param handle [IN] Device handle
  828. /// \param pFeatureName [IN] Feature name
  829. /// \param pEnumSymbol [OUT] Enumeration property symbol value
  830. /// \return Success, return IMV_OK. Failure, return error code
  831. IMV_API int IMV_CALL IMV_GetEnumFeatureSymbol(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pEnumSymbol);
  832. /// \~chinese
  833. /// \brief 设置枚举属性symbol值
  834. /// \param handle [IN] 设备句柄
  835. /// \param pFeatureName [IN] 属性名
  836. /// \param pEnumSymbol [IN] 待设置的枚举属性symbol值
  837. /// \return 成功,返回IMV_OK;错误,返回错误码
  838. /// \~english
  839. /// \brief Set enumeration property symbol value
  840. /// \param handle [IN] Device handle
  841. /// \param pFeatureName [IN] Feature name
  842. /// \param pEnumSymbol [IN] Enumeration property symbol value to be set
  843. /// \return Success, return IMV_OK. Failure, return error code
  844. IMV_API int IMV_CALL IMV_SetEnumFeatureSymbol(IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pEnumSymbol);
  845. /// \~chinese
  846. /// \brief 获取枚举属性的可设枚举值的个数
  847. /// \param handle [IN] 设备句柄
  848. /// \param pFeatureName [IN] 属性名
  849. /// \param pEntryNum [OUT] 枚举属性的可设枚举值的个数
  850. /// \return 成功,返回IMV_OK;错误,返回错误码
  851. /// \~english
  852. /// \brief Get the number of enumeration property settable enumeration
  853. /// \param handle [IN] Device handle
  854. /// \param pFeatureName [IN] Feature name
  855. /// \param pEntryNum [OUT] The number of enumeration property settable enumeration value
  856. /// \return Success, return IMV_OK. Failure, return error code
  857. IMV_API int IMV_CALL IMV_GetEnumFeatureEntryNum(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT unsigned int* pEntryNum);
  858. /// \~chinese
  859. /// \brief 获取枚举属性的可设枚举值列表
  860. /// \param handle [IN] 设备句柄
  861. /// \param pFeatureName [IN] 属性名
  862. /// \param pEnumEntryList [OUT] 枚举属性的可设枚举值列表
  863. /// \return 成功,返回IMV_OK;错误,返回错误码
  864. /// \~english
  865. /// \brief Get settable enumeration value list of enumeration property
  866. /// \param handle [IN] Device handle
  867. /// \param pFeatureName [IN] Feature name
  868. /// \param pEnumEntryList [OUT] Settable enumeration value list of enumeration property
  869. /// \return Success, return IMV_OK. Failure, return error code
  870. IMV_API int IMV_CALL IMV_GetEnumFeatureEntrys(IN IMV_HANDLE handle, IN const char* pFeatureName, IN_OUT IMV_EnumEntryList* pEnumEntryList);
  871. /// \~chinese
  872. /// \brief 获取字符串属性值
  873. /// \param handle [IN] 设备句柄
  874. /// \param pFeatureName [IN] 属性名
  875. /// \param pStringValue [OUT] 字符串属性值
  876. /// \return 成功,返回IMV_OK;错误,返回错误码
  877. /// \~english
  878. /// \brief Get string property value
  879. /// \param handle [IN] Device handle
  880. /// \param pFeatureName [IN] Feature name
  881. /// \param pStringValue [OUT] String property value
  882. /// \return Success, return IMV_OK. Failure, return error code
  883. IMV_API int IMV_CALL IMV_GetStringFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pStringValue);
  884. /// \~chinese
  885. /// \brief 设置字符串属性值
  886. /// \param handle [IN] 设备句柄
  887. /// \param pFeatureName [IN] 属性名
  888. /// \param pStringValue [IN] 待设置的字符串属性值
  889. /// \return 成功,返回IMV_OK;错误,返回错误码
  890. /// \~english
  891. /// \brief Set string property value
  892. /// \param handle [IN] Device handle
  893. /// \param pFeatureName [IN] Feature name
  894. /// \param pStringValue [IN] String property value to be set
  895. /// \return Success, return IMV_OK. Failure, return error code
  896. IMV_API int IMV_CALL IMV_SetStringFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pStringValue);
  897. /// \~chinese
  898. /// \brief 执行命令属性
  899. /// \param handle [IN] 设备句柄
  900. /// \param pFeatureName [IN] 属性名
  901. /// \return 成功,返回IMV_OK;错误,返回错误码
  902. /// \~english
  903. /// \brief Execute command property
  904. /// \param handle [IN] Device handle
  905. /// \param pFeatureName [IN] Feature name
  906. /// \return Success, return IMV_OK. Failure, return error code
  907. IMV_API int IMV_CALL IMV_ExecuteCommandFeature(IN IMV_HANDLE handle, IN const char* pFeatureName);
  908. /// \~chinese
  909. /// \brief 平场矫正转换 (不支持并发)
  910. /// \param handle [IN] 设备句柄
  911. /// \param frame [IN] 矫正帧
  912. /// \param pstImageCalibParam [IN][OUT] 平场矫正转换参数结构体
  913. /// \return 成功,返回IMV_OK;错误,返回错误码
  914. IMV_API int IMV_CALL IMV_ImageCalibFFC(IN IMV_HANDLE handle, IN IMV_Frame frame, IN_OUT IMV_ImageCalibFFCParam* param);
  915. /// \~chinese
  916. /// \brief 畸变矫正转换 (不支持并发)
  917. /// \param handle [IN] 设备句柄
  918. /// \param frame [IN] 矫正帧
  919. /// \param pstImageCalibParam [IN][OUT] 畸变矫正转换参数结构体
  920. /// \return 成功,返回IMV_OK;错误,返回错误码
  921. IMV_API int IMV_CALL IMV_ImageCalib(IN IMV_HANDLE handle, IN IMV_Frame frame, IN_OUT IMV_ImageCalibParam* pstImageCalibParam);
  922. /// \~chinese
  923. /// \brief 像素格式转换
  924. /// \param handle [IN] 设备句柄
  925. /// \param pstPixelConvertParam [IN][OUT] 像素格式转换参数结构体
  926. /// \return 成功,返回IMV_OK;错误,返回错误码
  927. /// \remarks
  928. /// 只支持转化成目标像素格式gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 / gvspPixelBGRA8\n
  929. /// 通过该接口将原始图像数据转换成用户所需的像素格式并存放在调用者指定内存中。\n
  930. /// 像素格式为YUV411Packed的时,图像宽须能被4整除\n
  931. /// 像素格式为YUV422Packed的时,图像宽须能被2整除\n
  932. /// 像素格式为YUYVPacked的时,图像宽须能被2整除\n
  933. /// 转换后的图像:数据存储是从最上面第一行开始的,这个是相机数据的默认存储方向
  934. /// \~english
  935. /// \brief Pixel format conversion
  936. /// \param handle [IN] Device handle
  937. /// \param pstPixelConvertParam [IN][OUT] Convert Pixel Type parameter structure
  938. /// \return Success, return IMV_OK. Failure, return error code
  939. /// \remarks
  940. /// Only support converting to destination pixel format of gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 / gvspPixelBGRA8\n
  941. /// This API is used to transform the collected original data to pixel format and save to specified memory by caller.\n
  942. /// pixelFormat:YUV411Packed, the image width is divisible by 4\n
  943. /// pixelFormat : YUV422Packed, the image width is divisible by 2\n
  944. /// pixelFormat : YUYVPacked,the image width is divisible by 2\n
  945. /// converted image:The first row of the image is located at the start of the image buffer.This is the default for image taken by a camera.
  946. IMV_API int IMV_CALL IMV_PixelConvert(IN IMV_HANDLE handle, IN_OUT IMV_PixelConvertParam* pstPixelConvertParam);
  947. /// \~chinese
  948. /// \brief 打开录像
  949. /// \param handle [IN] 设备句柄
  950. /// \param pstRecordParam [IN] 录像参数结构体
  951. /// \return 成功,返回IMV_OK;错误,返回错误码
  952. /// \~english
  953. /// \brief Open record
  954. /// \param handle [IN] Device handle
  955. /// \param pstRecordParam [IN] Record param structure
  956. /// \return Success, return IMV_OK. Failure, return error code
  957. IMV_API int IMV_CALL IMV_OpenRecord(IN IMV_HANDLE handle, IN IMV_RecordParam *pstRecordParam);
  958. /// \~chinese
  959. /// \brief 录制一帧图像
  960. /// \param handle [IN] 设备句柄
  961. /// \param pstRecordFrameInfoParam [IN] 录像用帧信息结构体
  962. /// \return 成功,返回IMV_OK;错误,返回错误码
  963. /// \~english
  964. /// \brief Record one frame
  965. /// \param handle [IN] Device handle
  966. /// \param pstRecordFrameInfoParam [IN] Frame information for recording structure
  967. /// \return Success, return IMV_OK. Failure, return error code
  968. IMV_API int IMV_CALL IMV_InputOneFrame(IN IMV_HANDLE handle, IN IMV_RecordFrameInfoParam *pstRecordFrameInfoParam);
  969. /// \~chinese
  970. /// \brief 关闭录像
  971. /// \param handle [IN] 设备句柄
  972. /// \return 成功,返回IMV_OK;错误,返回错误码
  973. /// \~english
  974. /// \brief Close record
  975. /// \param handle [IN] Device handle
  976. /// \return Success, return IMV_OK. Failure, return error code
  977. IMV_API int IMV_CALL IMV_CloseRecord(IN IMV_HANDLE handle);
  978. /// \~chinese
  979. /// \brief 图像翻转
  980. /// \param handle [IN] 设备句柄
  981. /// \param pstFlipImageParam [IN][OUT] 图像翻转参数结构体
  982. /// \return 成功,返回IMV_OK;错误,返回错误码
  983. /// \remarks
  984. /// 只支持像素格式gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8的图像的垂直和水平翻转。\n
  985. /// 通过该接口将原始图像数据翻转后并存放在调用者指定内存中。
  986. /// \~english
  987. /// \brief Flip image
  988. /// \param handle [IN] Device handle
  989. /// \param pstFlipImageParam [IN][OUT] Flip image parameter structure
  990. /// \return Success, return IMV_OK. Failure, return error code
  991. /// \remarks
  992. /// Only support vertical and horizontal flip of image data with gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 pixel format.\n
  993. /// This API is used to flip original data and save to specified memory by caller.
  994. IMV_API int IMV_CALL IMV_FlipImage(IN IMV_HANDLE handle, IN_OUT IMV_FlipImageParam* pstFlipImageParam);
  995. /// \~chinese
  996. /// \brief 图像顺时针旋转
  997. /// \param handle [IN] 设备句柄
  998. /// \param pstRotateImageParam [IN][OUT] 图像旋转参数结构体
  999. /// \return 成功,返回IMV_OK;错误,返回错误码
  1000. /// \remarks
  1001. /// 只支持gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8格式数据的90/180/270度顺时针旋转。\n
  1002. /// 通过该接口将原始图像数据旋转后并存放在调用者指定内存中。
  1003. /// \~english
  1004. /// \brief Rotate image clockwise
  1005. /// \param handle [IN] Device handle
  1006. /// \param pstRotateImageParam [IN][OUT] Rotate image parameter structure
  1007. /// \return Success, return IMV_OK. Failure, return error code
  1008. /// \remarks
  1009. /// Only support 90/180/270 clockwise rotation of data in the gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 format.\n
  1010. /// This API is used to rotation original data and save to specified memory by caller.
  1011. IMV_API int IMV_CALL IMV_RotateImage(IN IMV_HANDLE handle, IN_OUT IMV_RotateImageParam* pstRotateImageParam);
  1012. /// \~chinese
  1013. /// \brief 获取平场矫正系数文件
  1014. /// \param handle [IN] 设备句柄
  1015. /// \param param [IN][OUT] 平场矫正系数参数结构体
  1016. /// \return 成功,返回IMV_OK;错误,返回错误码
  1017. IMV_API int IMV_CALL IMV_GetLSCParam(IN IMV_HANDLE handle, IN IMV_LSCConfigParam* param);
  1018. /// \~chinese
  1019. /// \brief 平场矫正
  1020. /// \param handle [IN] 设备句柄
  1021. /// \param frame [IN] 矫正帧
  1022. /// \param pstImageCalibParam [IN][OUT] 平场矫正转换参数结构体
  1023. /// \return 成功,返回IMV_OK;错误,返回错误码
  1024. IMV_API int IMV_CALL IMV_LSCCorrect(IN IMV_HANDLE handle, IN IMV_Frame frame, IN_OUT IMV_LSCCorrectParam* pstImageCalibParam);
  1025. /// \~chinese
  1026. /// \brief 导入LSC系数文件
  1027. /// \param handle [IN] 设备句柄
  1028. /// \return 成功,返回IMV_OK;错误,返回错误码
  1029. IMV_API int IMV_CALL IMV_ImportLSCParam(IN IMV_HANDLE handle);
  1030. #ifdef __cplusplus
  1031. }
  1032. #endif
  1033. #endif // __IMV_API_H__