MvCameraControl.h 128 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019
  1. #ifndef _MV_CAMERA_CTRL_H_
  2. #define _MV_CAMERA_CTRL_H_
  3. #include "MvErrorDefine.h"
  4. #include "CameraParams.h"
  5. #include "MvObsoleteInterfaces.h"
  6. /************************************************************************/
  7. /* 动态库导入导出定义 */
  8. /* Import and export definition of the dynamic library */
  9. /************************************************************************/
  10. #ifndef MV_CAMCTRL_API
  11. #if (defined (_WIN32) || defined(WIN64))
  12. #if defined(MV_CAMCTRL_EXPORTS)
  13. #define MV_CAMCTRL_API __declspec(dllexport)
  14. #else
  15. #define MV_CAMCTRL_API __declspec(dllimport)
  16. #endif
  17. #else
  18. #ifndef __stdcall
  19. #define __stdcall
  20. #endif
  21. #ifndef MV_CAMCTRL_API
  22. #define MV_CAMCTRL_API
  23. #endif
  24. #endif
  25. #endif
  26. #ifndef IN
  27. #define IN
  28. #endif
  29. #ifndef OUT
  30. #define OUT
  31. #endif
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. /************************************************************************/
  36. /* 设备的基本指令和操作 */
  37. /* Camera basic instructions and operations */
  38. /************************************************************************/
  39. /********************************************************************//**
  40. * @~chinese
  41. * @brief 获取SDK版本号
  42. * @return 返回4字节版本号
  43. |主 |次 |修正 | 测试|
  44. 8bits 8bits 8bits 8bits
  45. * @remarks 比如返回值为0x01000001,即SDK版本号为V1.0.0.1。
  46. * @~english
  47. * @brief Get SDK Version
  48. * @return Always return 4 Bytes of version number
  49. |Main |Sub |Rev | Test|
  50. 8bits 8bits 8bits 8bits
  51. * @remarks For example, if the return value is 0x01000001, the SDK version is V1.0.0.1.
  52. ************************************************************************/
  53. MV_CAMCTRL_API unsigned int __stdcall MV_CC_GetSDKVersion();
  54. /********************************************************************//**
  55. * @~chinese
  56. * @brief 获取支持的传输层
  57. * @return 支持的传输层编号
  58. * @~english
  59. * @brief Get supported Transport Layer
  60. * @return Supported Transport Layer number
  61. ************************************************************************/
  62. MV_CAMCTRL_API int __stdcall MV_CC_EnumerateTls();
  63. /********************************************************************//**
  64. * @~chinese
  65. * @brief 枚举设备
  66. * @param nTLayerType [IN] 枚举传输层
  67. * @param pstDevList [OUT] 设备列表
  68. * @return 成功,返回MV_OK;错误,返回错误码
  69. * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,\n
  70. 建议尽量避免多线程枚举操作。
  71. * @~english
  72. * @brief Enumerate Device
  73. * @param nTLayerType [IN] Enumerate TLs
  74. * @param pstDevList [OUT] Device List
  75. * @return Success, return MV_OK. Failure, return error code
  76. * @remarks The memory of the device list is allocated within the SDK. When the interface is invoked by multiple threads, the memory of the device list will be released and applied.\n
  77. It is recommended to avoid multithreaded enumeration operations as much as possible.
  78. ************************************************************************/
  79. MV_CAMCTRL_API int __stdcall MV_CC_EnumDevices(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList);
  80. /********************************************************************//**
  81. * @~chinese
  82. * @brief 根据厂商名字枚举设备
  83. * @param nTLayerType [IN] 枚举传输层
  84. * @param pstDevList [OUT] 设备列表
  85. * @param strManufacturerName [IN] 厂商名字
  86. * @return 成功,返回MV_OK;错误,返回错误码
  87. * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,\n
  88. 建议尽量避免多线程枚举操作。
  89. * @~english
  90. * @brief Enumerate device according to manufacture name
  91. * @param nTLayerType [IN] Transmission layer of enumeration
  92. * @param pstDevList [OUT] Device list
  93. * @param strManufacturerName [IN] Manufacture Name
  94. * @return Success, return MV_OK. Failure, return error code
  95. * @remarks The memory of the device list is allocated within the SDK. When the interface is invoked by multiple threads, the memory of the device list will be released and applied.\n
  96. It is recommended to avoid multithreaded enumeration operations as much as possible.
  97. ************************************************************************/
  98. MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesEx(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList, IN const char* strManufacturerName);
  99. /********************************************************************//**
  100. * @~chinese
  101. * @brief 设备是否可达
  102. * @param pstDevInfo [IN] 设备信息结构体
  103. * @param nAccessMode [IN] 访问权限
  104. * @return 可达,返回true;不可达,返回false
  105. * @remarks 读取设备CCP寄存器的值,判断当前状态是否具有某种访问权限。 \n
  106. 如果设备不支持MV_ACCESS_ExclusiveWithSwitch、MV_ACCESS_ControlWithSwitch、MV_ACCESS_ControlSwitchEnableWithKey这三种模式,接口返回false。目前设备不支持这3种抢占模式,国际上主流的厂商的设备也都暂不支持这3种模式。 \n
  107. 该接口不支持CameraLink设备。
  108. * @~english
  109. * @brief Is the device accessible
  110. * @param pstDevInfo [IN] Device Information Structure
  111. * @param nAccessMode [IN] Access Right
  112. * @return Access, return true. Not access, return false
  113. * @remarks Read device CCP register value and determine current access permission.\n
  114. Return false if the device does not support the modes MV_ACCESS_ExclusiveWithSwitch, MV_ACCESS_ControlWithSwitch, MV_ACCESS_ControlSwitchEnableWithKey. Currently the device does not support the 3 preemption modes, neither do the devices from other mainstream manufacturers. \n
  115. This API is not supported by CameraLink device.
  116. ************************************************************************/
  117. MV_CAMCTRL_API bool __stdcall MV_CC_IsDeviceAccessible(IN MV_CC_DEVICE_INFO* pstDevInfo, IN unsigned int nAccessMode);
  118. /********************************************************************//**
  119. * @~chinese
  120. * @brief 设置SDK日志路径
  121. * @param strSDKLogPath [IN] SDK日志路径
  122. * @return 成功,返回MV_OK;错误,返回错误码
  123. * @remarks 设置路径之后,可以指定路径存放日志。\n
  124. v2.4.1版本新增日志服务,开启服务之后该接口无效,默认日志服务为开启状态。
  125. * @~english
  126. * @brief Set SDK log path
  127. * @param strSDKLogPath [IN] SDK log path
  128. * @return Access, return true. Not access, return false
  129. * @remarks For version V2.4.1, added log service, this API is invalid when the service is enabled.And The logging service is enabled by default\n
  130. This API is used to set the log file storing path.
  131. ************************************************************************/
  132. MV_CAMCTRL_API int __stdcall MV_CC_SetSDKLogPath(IN const char * strSDKLogPath);
  133. /********************************************************************//**
  134. * @~chinese
  135. * @brief 创建设备句柄
  136. * @param handle [OUT] 设备句柄
  137. * @param pstDevInfo [IN] 设备信息结构体
  138. * @return 成功,返回MV_OK;错误,返回错误码
  139. * @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块。通过该接口创建句柄,调用SDK接口,会默认生成SDK日志文件,如果不需要生成日志文件,可以通过MV_CC_CreateHandleWithoutLog创建句柄。
  140. * @~english
  141. * @brief Create Device Handle
  142. * @param handle [OUT] Device handle
  143. * @param pstDevInfo [IN] Device Information Structure
  144. * @return Success, return MV_OK. Failure, return error code
  145. * @remarks Create required resources within library and initialize internal module according to input device information. Create handle and call SDK interface through this interface, and SDK log file will be created by default. Creating handle through MV_CC_CreateHandleWithoutLog will not generate log files.
  146. ************************************************************************/
  147. MV_CAMCTRL_API int __stdcall MV_CC_CreateHandle(OUT void ** handle, IN const MV_CC_DEVICE_INFO* pstDevInfo);
  148. /********************************************************************//**
  149. * @~chinese
  150. * @brief 创建设备句柄,不生成日志
  151. * @param handle [OUT] 设备句柄
  152. * @param pstDevInfo [IN] 设备信息结构体
  153. * @return 成功,返回MV_OK;错误,返回错误码
  154. * @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块。通过该接口创建句柄,调用SDK接口,不会默认生成SDK日志文件,如果需要生成日志文件可以通过MV_CC_CreateHandle创建句柄,日志文件自动生成。
  155. * @~english
  156. * @brief Create Device Handle without log
  157. * @param handle [OUT] Device handle
  158. * @param pstDevInfo [IN] Device Information Structure
  159. * @return Success, return MV_OK. Failure, return error code
  160. * @remarks Create required resources within library and initialize internal module according to input device information. Create handle and call SDK interface through this interface, and SDK log file will not be created. To create logs, create handle through MV_CC_CreateHandle, and log files will be automatically generated.
  161. ************************************************************************/
  162. MV_CAMCTRL_API int __stdcall MV_CC_CreateHandleWithoutLog(OUT void ** handle, IN const MV_CC_DEVICE_INFO* pstDevInfo);
  163. /********************************************************************//**
  164. * @~chinese
  165. * @brief 销毁设备句柄
  166. * @param handle [IN] 设备句柄
  167. * @return 成功,返回MV_OK;错误,返回错误码
  168. * @~english
  169. * @brief Destroy Device Handle
  170. * @param handle [IN] Device handle
  171. * @return Success, return MV_OK. Failure, return error code
  172. ************************************************************************/
  173. MV_CAMCTRL_API int __stdcall MV_CC_DestroyHandle(IN void * handle);
  174. /********************************************************************//**
  175. * @~chinese
  176. * @brief 打开设备
  177. * @param handle [IN] 设备句柄
  178. * @param nAccessMode [IN] 访问权限
  179. * @param nSwitchoverKey [IN] 切换访问权限时的密钥
  180. * @return 成功,返回MV_OK;错误,返回错误码
  181. * @remarks 根据设置的设备参数,找到对应的设备,连接设备。\n
  182. 调用接口时可不传入nAccessMode和nSwitchoverKey,此时默认设备访问模式为独占权限。目前设备暂不支持MV_ACCESS_ExclusiveWithSwitch、MV_ACCESS_ControlWithSwitch、MV_ACCESS_ControlSwitchEnable、MV_ACCESS_ControlSwitchEnableWithKey这四种抢占模式。\n
  183. 对于U3V设备,nAccessMode、nSwitchoverKey这两个参数无效。
  184. * @~english
  185. * @brief Open Device
  186. * @param handle [IN] Device handle
  187. * @param nAccessMode [IN] Access Right
  188. * @param nSwitchoverKey [IN] Switch key of access right
  189. * @return Success, return MV_OK. Failure, return error code
  190. * @remarks Find specific device and connect according to set device parameters. \n
  191. When calling the interface, the input of nAccessMode and nSwitchoverKey is optional, and the device access mode is exclusive. Currently the device does not support the following preemption modes: MV_ACCESS_ExclusiveWithSwitch, MV_ACCESS_ControlWithSwitch, MV_ACCESS_ControlSwitchEnableWithKey.\n
  192. For USB3Vision device, nAccessMode, nSwitchoverKey are invalid.
  193. ************************************************************************/
  194. #ifndef __cplusplus
  195. MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, IN unsigned int nAccessMode, IN unsigned short nSwitchoverKey);
  196. #else
  197. MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, IN unsigned int nAccessMode = MV_ACCESS_Exclusive, IN unsigned short nSwitchoverKey = 0);
  198. #endif
  199. /********************************************************************//**
  200. * @~chinese
  201. * @brief 关闭设备
  202. * @param handle [IN] 设备句柄
  203. * @return 成功,返回MV_OK;错误,返回错误码
  204. * @remarks 通过MV_CC_OpenDevice连接设备后,可以通过该接口断开设备连接,释放资源
  205. * @~english
  206. * @brief Close Device
  207. * @param handle [IN] Device handle
  208. * @return Success, return MV_OK. Failure, return error code
  209. * @remarks After connecting to device through MV_CC_OpenDevice, use this interface to disconnect and release resources.
  210. ***********************************************************************/
  211. MV_CAMCTRL_API int __stdcall MV_CC_CloseDevice(IN void* handle);
  212. /********************************************************************//**
  213. * @~chinese
  214. * @brief 判断设备是否处于连接状态
  215. * @param handle [IN] 设备句柄
  216. * @return 设备处于连接状态,返回true;没连接或失去连接,返回false
  217. * @~english
  218. * @brief Is The Device Connected
  219. * @param handle [IN] Device handle
  220. * @return Connected, return true. Not Connected or DIsconnected, return false
  221. ***********************************************************************/
  222. MV_CAMCTRL_API bool __stdcall MV_CC_IsDeviceConnected(IN void* handle);
  223. /********************************************************************//**
  224. * @~chinese
  225. * @brief 注册图像数据回调
  226. * @param handle [IN] 设备句柄
  227. * @param cbOutput [IN] 回调函数指针
  228. * @param pUser [IN] 用户自定义变量
  229. * @return 成功,返回MV_OK;错误,返回错误码
  230. * @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用。 \n
  231. 图像数据采集有两种方式,两种方式不能复用:\n
  232. 方式一:调用MV_CC_RegisterImageCallBackEx设置图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回。\n
  233. 方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetOneFrameTimeout获取指定像素格式的帧数据,获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 \n
  234. 该接口不支持CameraLink设备。
  235. * @~english
  236. * @brief Register the image callback function
  237. * @param handle [IN] Device handle
  238. * @param cbOutput [IN] Callback function pointer
  239. * @param pUser [IN] User defined variable
  240. * @return Success, return MV_OK. Failure, return error code
  241. * @remarks After MV_CC_CreateHandle, call this interface to set image data callback function.\n
  242. There are two available image data acquisition modes, and cannot be used together: \n
  243. Mode 1: Call MV_CC_RegisterImageCallBack to set image data callback function, and then callMV_CC_StartGrabbing to start acquiring. The acquired image data will return in the set callback function.\n
  244. Mode 2: Call MV_CC_StartGrabbing to start acquiring, and then call MV_CC_GetOneFrameTimeout repeatedly in application layer to get frame data of specified pixel format. When getting frame data, the frequency of calling this interface should be controlled by upper layer application according to frame rate. \n
  245. This API is not supported by CameraLink device.
  246. ***********************************************************************/
  247. MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackEx(void* handle,
  248. void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),
  249. void* pUser);
  250. /********************************************************************//**
  251. * @~chinese
  252. * @brief 注册图像数据回调,RGB
  253. * @param handle [IN] 设备句柄
  254. * @param cbOutput [IN] 回调函数指针
  255. * @param pUser [IN] 用户自定义变量
  256. * @return 成功,返回MV_OK;错误,返回错误码
  257. * @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用。 \n
  258. 图像数据采集有两种方式,两种方式不能复用:\n
  259. 方式一:调用MV_CC_RegisterImageCallBackForRGB设置RGB24格式图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回。\n
  260. 方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetImageForRGB获取RGB24格式的帧数据,获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 \n
  261. 该接口不支持CameraLink设备。
  262. * @~english
  263. * @brief register image data callback, RGB
  264. * @param handle [IN] Device handle
  265. * @param cbOutput [IN] Callback function pointer
  266. * @param pUser [IN] User defined variable
  267. * @return Success, return MV_OK. Failure, return error code
  268. * @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle. \n
  269. There are two image acquisition modes, the two modes cannot be reused: \n
  270. Mode 1: Call MV_CC_RegisterImageCallBackForRGB to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function.\n
  271. Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForRGB repeatedly in application layer to get frame data with RGB24 format. When getting frame data, the upper application program should control the frequency of calling this API according to frame rate. \n
  272. This API is not supported by CameraLink device.
  273. ***********************************************************************/
  274. MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackForRGB(void* handle,
  275. void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),
  276. void* pUser);
  277. /********************************************************************//**
  278. * @~chinese
  279. * @brief 注册图像数据回调,BGR
  280. * @param handle [IN] 设备句柄
  281. * @param cbOutput [IN] 回调函数指针
  282. * @param pUser [IN] 用户自定义变量
  283. * @return 成功,返回MV_OK;错误,返回错误码
  284. * @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用。\n
  285. 图像数据采集有两种方式,两种方式不能复用:\n
  286. 方式一:调用MV_CC_RegisterImageCallBackForBGR设置BGR24图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回。\n
  287. 方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetImageForBGR获取BGR24格式的帧数据,获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 \n
  288. 该接口不支持CameraLink设备。
  289. * @~english
  290. * @brief register image data callback, BGR
  291. * @param handle [IN] Device handle
  292. * @param cbOutput [IN] Callback function pointer
  293. * @param pUser [IN] User defined variable
  294. * @return Success, return MV_OK. Failure, return error code
  295. * @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle. \n
  296. There are two image acquisition modes, the two modes cannot be reused: \n
  297. Mode 1: Call MV_CC_RegisterImageCallBackForBGR to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function.\n
  298. Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForBGR repeatedly in application layer to get frame data with BGR24 format. When getting frame data, the upper application program should control the frequency of calling this API according to frame rate.\n
  299. This API is not supported by CameraLink device.
  300. ***********************************************************************/
  301. MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackForBGR(void* handle,
  302. void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),
  303. void* pUser);
  304. /********************************************************************//**
  305. * @~chinese
  306. * @brief 开始取流
  307. * @param handle [IN] 设备句柄
  308. * @return 成功,返回MV_OK;错误,返回错误码
  309. * @remarks 该接口不支持CameraLink设备。
  310. * @~english
  311. * @brief Start Grabbing
  312. * @param handle [IN] Device handle
  313. * @return Success, return MV_OK. Failure, return error code
  314. * @remarks This API is not supported by CameraLink device.
  315. ***********************************************************************/
  316. MV_CAMCTRL_API int __stdcall MV_CC_StartGrabbing(IN void* handle);
  317. /********************************************************************//**
  318. * @~chinese
  319. * @brief 停止取流
  320. * @param handle [IN] 设备句柄
  321. * @return 成功,返回MV_OK;错误,返回错误码
  322. * @remarks 该接口不支持CameraLink设备。
  323. * @~english
  324. * @brief Stop Grabbing
  325. * @param handle [IN] Device handle
  326. * @return Success, return MV_OK. Failure, return error code
  327. * @remarks This API is not supported by CameraLink device.
  328. ***********************************************************************/
  329. MV_CAMCTRL_API int __stdcall MV_CC_StopGrabbing(IN void* handle);
  330. /********************************************************************//**
  331. * @~chinese
  332. * @brief 获取一帧RGB数据,此函数为查询式获取,每次调用查询内部
  333. 缓存有无数据,有数据则获取数据,无数据返回错误码
  334. * @param handle [IN] 设备句柄
  335. * @param pData [OUT] 图像数据接收指针
  336. * @param nDataSize [IN] 接收缓存大小
  337. * @param pstFrameInfo [OUT] 图像信息结构体
  338. * @param nMsec [IN] 等待超时时间
  339. * @return 成功,返回MV_OK;错误,返回错误码
  340. * @remarks 每次调用该接口,将查询内部缓存是否有数据,如果有数据则转换成RGB24格式返回,如果没有数据则返回错误码。因为图像转换成RGB24格式有耗时,所以当数据帧率过高时该接口可能会导致丢帧。\n
  341. 调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。 \n
  342. 该接口不支持CameraLink设备。
  343. * @~english
  344. * @brief Get one frame of RGB data, this function is using query to get data
  345. query whether the internal cache has data, get data if there has, return error code if no data
  346. * @param handle [IN] Device handle
  347. * @param pData [OUT] Image data receiving buffer
  348. * @param nDataSize [IN] Buffer size
  349. * @param pstFrameInfo [OUT] Image information structure
  350. * @param nMsec [IN] Waiting timeout
  351. * @return Success, return MV_OK. Failure, return error code
  352. * @remarks Each time the API is called, the internal cache is checked for data. If there is data, it will be transformed as RGB24 format for return, if there is no data, return error code. As time-consuming exists when transform the image to RGB24 format, this API may cause frame loss when the data frame rate is too high. \n
  353. Before calling this API to get image data frame, call MV_CC_StartGrabbing to start image acquisition. This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. \n
  354. This API is not supported by CameraLink device.
  355. ***********************************************************************/
  356. MV_CAMCTRL_API int __stdcall MV_CC_GetImageForRGB(IN void* handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, int nMsec);
  357. /********************************************************************//**
  358. * @~chinese
  359. * @brief 获取一帧BGR数据,此函数为查询式获取,每次调用查询内部
  360. 缓存有无数据,有数据则获取数据,无数据返回错误码
  361. * @param handle [IN] 设备句柄
  362. * @param pData [OUT] 图像数据接收指针
  363. * @param nDataSize [IN] 接收缓存大小
  364. * @param pstFrameInfo [OUT] 图像信息结构体
  365. * @param nMsec [IN] 等待超时时间
  366. * @return 成功,返回MV_OK;错误,返回错误码
  367. * @remarks 每次调用该接口,将查询内部缓存是否有数据,如果有数据则转换成BGR24格式返回,如果没有数据则返回错误码。因为图像转换成BGR24格式有耗时,所以当数据帧率过高时该接口可能会导致丢帧。 \n
  368. 调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。\n
  369. 该接口不支持CameraLink设备。
  370. * @~english
  371. * @brief Get one frame of BGR data, this function is using query to get data
  372. query whether the internal cache has data, get data if there has, return error code if no data
  373. * @param handle [IN] Device handle
  374. * @param pData [OUT] Image data receiving buffer
  375. * @param nDataSize [IN] Buffer size
  376. * @param pstFrameInfo [OUT] Image information structure
  377. * @param nMsec [IN] Waiting timeout
  378. * @return Success, return MV_OK. Failure, return error code
  379. * @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle. \n
  380. There are two image acquisition modes, the two modes cannot be reused: \n
  381. Mode 1: Call MV_CC_RegisterImageCallBackForBGR to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function.\n
  382. Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForBGR repeatedly in application layer to get frame data with BGR24 format. When getting frame data, the upper application program should control the frequency of calling this API according to frame rate. \n
  383. This API is not supported by CameraLink device.
  384. ***********************************************************************/
  385. MV_CAMCTRL_API int __stdcall MV_CC_GetImageForBGR(IN void* handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, int nMsec);
  386. /********************************************************************//**
  387. * @~chinese
  388. * @brief 使用内部缓存获取一帧图片(与MV_CC_Display不能同时使用)
  389. * @param handle [IN] 设备句柄
  390. * @param pstFrame [OUT] 图像数据和图像信息
  391. * @param nMsec [IN] 等待超时时间,输入INFINITE时表示无限等待,直到收到一帧数据或者停止取流
  392. * @return 成功,返回MV_OK;错误,返回错误码
  393. * @remarks 调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。该接口支持设置超时时间,SDK内部等待直到有数据时返回,可以增加取流平稳性,适合用于对平稳性要求较高的场合。 \n
  394. 该接口与MV_CC_FreeImageBuffer配套使用,当处理完取到的数据后,需要用MV_CC_FreeImageBuffer接口将pFrame内的数据指针权限进行释放。 \n
  395. 该接口与MV_CC_GetOneFrameTimeout相比,有着更高的效率。且其取流缓存的分配是由sdk内部自动分配的,而MV_CC_GetOneFrameTimeout接口是需要客户自行分配。\n
  396. 该接口在调用MV_CC_Display后无法取流。 \n
  397. 该接口对于U3V、GIGE设备均可支持。 \n
  398. 该接口不支持CameraLink设备。
  399. * @~english
  400. * @brief Get a frame of an image using an internal cache
  401. * @param handle [IN] Device handle
  402. * @param pstFrame [OUT] Image data and image information
  403. * @param nMsec [IN] Waiting timeout
  404. * @return Success, return MV_OK. Failure, return error code
  405. * @remarks Before calling this API to get image data frame, you should call MV_CC_StartGrabbing to start image acquisition. This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. This API support setting timeout, and SDK will wait to return until data appears. This function will increase the streaming stability, which can be used in the situation with high stability requirement. \n
  406. This API and MV_CC_FreeImageBuffer should be called in pairs, after processing the acquired data, you should call MV_CC_FreeImageBuffer to release the data pointer permission of pFrame. \n
  407. This interface is more efficient than MV_CC_GetOneFrameTimeout. The allocation of the stream cache is automatically allocated within the SDK.The MV_CC_GetOneFrameTimeout interface needs to be allocated by customers themselves. \n
  408. This API cannot be called to stream after calling MV_CC_Display. \n
  409. This API is not supported by CameraLink device. \n
  410. This API is supported by both USB3 vision camera and GigE camera. \n
  411. **********************************************************************/
  412. MV_CAMCTRL_API int __stdcall MV_CC_GetImageBuffer(IN void* handle, OUT MV_FRAME_OUT* pstFrame, IN unsigned int nMsec);
  413. /********************************************************************//**
  414. * @~chinese
  415. * @brief 释放图像缓存(此接口用于释放不再使用的图像缓存,与MV_CC_GetImageBuffer配套使用)
  416. * @param handle [IN] 设备句柄
  417. * @param pstFrame [IN] 图像数据和图像数据
  418. * @return 成功,返回MV_OK;错误,返回错误码
  419. * @remarks 该接口与MV_CC_GetImageBuffer配套使用,使用MV_CC_GetImageBuffer接口取到的图像数据pFrame,需要用MV_CC_FreeImageBuffer接口进行权限释放。 \n
  420. 该接口对于取流效率高于GetOneFrameTimeout接口,且GetImageBuffer在不进行Free的情况下,最大支持输出的节点数与SetImageNode接口所设置的节点数相等,默认节点数是1。\n
  421. 该接口对于U3V、GIGE设备均可支持。 \n
  422. 该接口不支持CameraLink设备。
  423. * @~english
  424. * @brief Free image buffer(this interface can free image buffer, used with MV_CC_GetImageBuffer)
  425. * @param handle [IN] Device handle
  426. * @param pstFrame [IN] Image data and image information
  427. * @return Success, return MV_OK. Failure, return error code
  428. * @remarks This API and MV_CC_GetImageBuffer should be called in pairs, before calling MV_CC_GetImageBuffer to get image data pFrame, you should call MV_CC_FreeImageBuffer to release the permission. \n
  429. Compared with API MV_CC_GetOneFrameTimeout, this API has higher efficiency of image acquisition. The max. number of nodes can be outputted is same as the "nNum" of API MV_CC_SetImageNodeNum, default value is 1. \n
  430. This API is not supported by CameraLink device. \n
  431. This API is supported by both USB3 vision camera and GigE camera.
  432. **********************************************************************/
  433. MV_CAMCTRL_API int __stdcall MV_CC_FreeImageBuffer(IN void* handle, IN MV_FRAME_OUT* pstFrame);
  434. /********************************************************************//**
  435. * @~chinese
  436. * @brief 采用超时机制获取一帧图片,SDK内部等待直到有数据时返回
  437. * @param handle [IN] 设备句柄
  438. * @param pData [OUT] 图像数据接收指针
  439. * @param nDataSize [IN] 接收缓存大小
  440. * @param pstFrameInfo [OUT] 图像信息结构体
  441. * @param nMsec [IN] 等待超时时间
  442. * @return 成功,返回MV_OK;错误,返回错误码
  443. * @remarks 调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。该接口支持设置超时时间,SDK内部等待直到有数据时返回,可以增加取流平稳性,适合用于对平稳性要求较高的场合。\n
  444. 该接口对于U3V、GIGE设备均可支持。\n
  445. 该接口不支持CameraLink设备。
  446. * @~english
  447. * @brief Timeout mechanism is used to get image, and the SDK waits inside until the data is returned
  448. * @param handle [IN] Device handle
  449. * @param pData [OUT] Image data receiving buffer
  450. * @param nDataSize [IN] Buffer size
  451. * @param pstFrameInfo [OUT] Image information structure
  452. * @param nMsec [IN] Waiting timeout
  453. * @return Success, return MV_OK. Failure, return error code
  454. * @remarks Before calling this API to get image data frame, call MV_CC_StartGrabbing to start image acquisition. This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. This API supports setting timeout, SDK will wait to return until data appears. This function will increase the streaming stability, which can be used in the situation with high stability requirement. \n
  455. Both the USB3Vision and GIGE camera can support this API. \n
  456. This API is not supported by CameraLink device.
  457. ***********************************************************************/
  458. MV_CAMCTRL_API int __stdcall MV_CC_GetOneFrameTimeout(IN void* handle, IN OUT unsigned char* pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, unsigned int nMsec);
  459. /********************************************************************//**
  460. * @~chinese
  461. * @brief 清除取流数据缓存
  462. * @param handle [IN] 设备句柄
  463. * @return 成功,返回MV_OK;错误,返回错误码
  464. * @remarks 该接口允许用户在不停止取流的时候,就能清除缓存中不需要的图像。\n
  465. 该接口在连续模式切触发模式后,可以清除历史数据。
  466. * @~english
  467. * @brief if Image buffers has retrieved the data,Clear them
  468. * @param handle [IN] Device handle
  469. * @return Success, return MV_OK. Failure, return error code
  470. * @remarks This interface allows user to clear the unnecessary images from the buffer memory without stopping acquisition. \n
  471. This interface allows user to clear previous data after switching from continuous mode to trigger mode.
  472. ***********************************************************************/
  473. MV_CAMCTRL_API int __stdcall MV_CC_ClearImageBuffer(IN void* handle);
  474. /********************************************************************//**
  475. * @~chinese
  476. * @brief 显示一帧图像
  477. * @param handle [IN] 设备句柄
  478. * @param pstDisplayInfo [IN] 图像信息
  479. * @return 成功,返回MV_OK;错误,返回错误码
  480. * @remarks 该接口对于U3V、GIGE设备均可支持。\n
  481. 该接口不支持CameraLink设备。
  482. * @~english
  483. * @brief Display one frame image
  484. * @param handle [IN] Device handle
  485. * @param pstDisplayInfo [IN] Frame Info
  486. * @return Success, return MV_OK. Failure, return error code
  487. * @remarks This API is valid for USB3Vision camera and GIGE camera. \n
  488. This API is not supported by CameraLink device.
  489. ***********************************************************************/
  490. MV_CAMCTRL_API int __stdcall MV_CC_DisplayOneFrame(IN void* handle, IN MV_DISPLAY_FRAME_INFO* pstDisplayInfo);
  491. /********************************************************************//**
  492. * @~chinese
  493. * @brief 设置SDK内部图像缓存节点个数,大于等于1,在抓图前调用
  494. * @param handle [IN] 设备句柄
  495. * @param nNum [IN] 缓存节点个数
  496. * @return 成功,返回MV_OK;错误,返回错误码
  497. * @remarks 调用该接口可以设置SDK内部图像缓存节点个数,在调用MV_CC_StartGrabbing开始抓图前调用。\n
  498. 在SDK中默认是1个节点。\n
  499. 该接口不支持CameraLink设备。
  500. * @~english
  501. * @brief Set the number of the internal image cache nodes in SDK, Greater than or equal to 1, to be called before the capture
  502. * @param handle [IN] Device handle
  503. * @param nNum [IN] Image Node Number
  504. * @return Success, return MV_OK. Failure, return error code
  505. * @remarks Call this interface to set the number of SDK internal image buffer nodes. The interface should be called before calling MV_CC_StartGrabbing for capturing. \n
  506. This API is not supported by CameraLink device.
  507. ***********************************************************************/
  508. MV_CAMCTRL_API int __stdcall MV_CC_SetImageNodeNum(IN void* handle, unsigned int nNum);
  509. /********************************************************************//**
  510. * @~chinese
  511. * @brief 设置取流策略
  512. * @param handle [IN] 设备句柄
  513. * @param enGrabStrategy [IN] 策略枚举值
  514. * @return 成功,返回MV_OK;错误,返回错误码
  515. * @remarks 该接口定义了四种取流策略,用户可以根据实际需求进行选择。具体描述如下:
  516. -OneByOne:从旧到新一帧一帧的从输出缓存列表中获取图像,打开设备后默认为该策略
  517. -LatestImagesOnly:仅从输出缓存列表中获取最新的一帧图像,同时清空输出缓存列表
  518. -LatestImages:从输出缓存列表中获取最新的OutputQueueSize帧图像,其中OutputQueueSize范围为1-ImageNodeNum,可用MV_CC_SetOutputQueueSize接口设置,ImageNodeNum默认为1,可用MV_CC_SetImageNodeNum接口设置 OutputQueueSize设置成1等同于LatestImagesOnly策略,OutputQueueSize设置成ImageNodeNum等同于OneByOne策略
  519. -UpcomingImage:在调用取流接口时忽略输出缓存列表中所有图像,并等待设备即将生成的一帧图像。该策略只支持GigE设备,不支持U3V设备
  520. * @~english
  521. * @brief Set Grab Strategy
  522. * @param handle [IN] Device handle
  523. * @param enGrabStrategy [IN] The value of Grab Strategy
  524. * @return Success, return MV_OK. Failure, return error code
  525. * @remarks This interface is set by four image acquisition approaches, the user may choose one as needed. Specific details are as followed:
  526. -OneByOne:Obtain image from output cache list frame by frame in order, this function is default strategy when device is on.
  527. -LatestImagesOnly:Obtain the latest image from output cache list only, meanwhile clear output cache list.
  528. -LatestImages:Obtain the latest OutputQueueSize image from output cache list, the range of OutputQueueSize is 1-ImageNodeNum, the user may set the value of MV_CC_SetOutputQueueSizeinterface,the default value of ImageNodeNum is 1,If the user usesMV_CC_SetImageNodeNuminterface to set up OutputQueueSize,when the value of OutputQueueSize is set to be 1, the function will be same as LatestImagesOnly; if the value of OutputQueueSize is set to be ImageNodeNum, the function will be same as OneByOne.
  529. -UpcomingImage:Ignore all images in output cache list when calling image acuiqisiotn interface, wait the next upcoming image generated. Support for GigE camera only, not support for U3V camera.
  530. ***********************************************************************/
  531. MV_CAMCTRL_API int __stdcall MV_CC_SetGrabStrategy(IN void* handle, IN MV_GRAB_STRATEGY enGrabStrategy);
  532. /********************************************************************//**
  533. * @~chinese
  534. * @brief 设置输出缓存个数(只有在MV_GrabStrategy_LatestImages策略下才有效,范围:1-ImageNodeNum)
  535. * @param handle [IN] 设备句柄
  536. * @param nOutputQueueSize [IN] 输出缓存个数
  537. * @return 成功,返回MV_OK;错误,返回错误码
  538. * @remarks 该接口需与LatestImages取流策略配套调用,用于设置LatestImages策略下最多允许缓存图像的个数。可以在取流过程中动态调节输出缓存个数
  539. * @~english
  540. * @brief Set The Size of Output Queue(Only work under the strategy of MV_GrabStrategy_LatestImages,rang:1-ImageNodeNum)
  541. * @param handle [IN] Device handle
  542. * @param nOutputQueueSize [IN] The Size of Output Queue
  543. * @return Success, return MV_OK. Failure, return error code
  544. * @remarks This interface must be used with LatestImages Grab strategy, it is used for setting the maximum allowance queue size of the image under the LatestImages strategy. The user may change the output queue size while grabbing images.
  545. ***********************************************************************/
  546. MV_CAMCTRL_API int __stdcall MV_CC_SetOutputQueueSize(IN void* handle, IN unsigned int nOutputQueueSize);
  547. /********************************************************************//**
  548. * @~chinese
  549. * @brief 获取设备信息,取流之前调用
  550. * @param handle [IN] 设备句柄
  551. * @param pstDevInfo [IN][OUT] 返回给调用者有关设备信息结构体指针
  552. * @return 成功,返回MV_OK,失败,返回错误码
  553. * @remarks 支持用户在打开设备后获取设备信息。\n
  554. 若该设备是GigE设备,则调用该接口存在阻塞风险,因此不建议在取流过程中调用该接口。
  555. * @~english
  556. * @brief Get device information
  557. * @param handle [IN] Device handle
  558. * @param pstDevInfo [IN][OUT] Structure pointer of device information
  559. * @return Success, return MV_OK. Failure, return error code
  560. * @remarks The API support users to access device information after opening the device. \n
  561. If the device is a GigE camera, there is a blocking risk in calling the interface, so it is not recommended to call the interface during the fetching process.
  562. ************************************************************************/
  563. MV_CAMCTRL_API int __stdcall MV_CC_GetDeviceInfo(IN void * handle, IN OUT MV_CC_DEVICE_INFO* pstDevInfo);
  564. /********************************************************************//**
  565. * @~chinese
  566. * @brief 获取各种类型的信息
  567. * @param handle [IN] 设备句柄
  568. * @param pstInfo [IN][OUT] 返回给调用者有关设备各种类型的信息结构体指针
  569. * @return 成功,返回MV_OK,失败,返回错误码
  570. * @remarks 接口里面输入需要获取的信息类型(指定MV_ALL_MATCH_INFO结构体中的nType类型),获取对应的信息(在MV_ALL_MATCH_INFO结构体中pInfo里返回)。 \n
  571. 该接口的调用前置条件取决于所获取的信息类型,获取GigE设备的MV_MATCH_TYPE_NET_DETECT信息需在开启抓图之后调用,获取U3V设备的MV_MATCH_TYPE_USB_DETECT信息需在打开设备之后调用。 \n
  572. 该接口不支持CameraLink设备。
  573. * @~english
  574. * @brief Get various type of information
  575. * @param handle [IN] Device handle
  576. * @param pstInfo [IN][OUT] Structure pointer of various type of information
  577. * @return Success, return MV_OK. Failure, return error code
  578. * @remarks Input required information type (specify nType in structure MV_ALL_MATCH_INFO) in the interface and get corresponding information (return in pInfo of structure MV_ALL_MATCH_INFO). \n
  579. The calling precondition of this interface is determined by obtained information type. Call after enabling capture to get MV_MATCH_TYPE_NET_DETECT information of GigE device, and call after starting device to get MV_MATCH_TYPE_USB_DETECT information of USB3Vision device. \n
  580. This API is not supported by CameraLink device.
  581. ************************************************************************/
  582. MV_CAMCTRL_API int __stdcall MV_CC_GetAllMatchInfo(IN void* handle, IN OUT MV_ALL_MATCH_INFO* pstInfo);
  583. /************************************************************************/
  584. /* 设置和获取设备参数的万能接口 */
  585. /* General interface for getting and setting camera parameters */
  586. /************************************************************************/
  587. /********************************************************************//**
  588. * @~chinese
  589. * @brief 获取Integer属性值
  590. * @param handle [IN] 设备句柄
  591. * @param strKey [IN] 属性键值,如获取宽度信息则为"Width"
  592. * @param pstIntValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  593. * @return 成功,返回MV_OK,失败,返回错误码
  594. * @remarks 连接设备之后调用该接口可以获取int类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IInteger”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
  595. * @~english
  596. * @brief Get Integer value
  597. * @param handle [IN] Device handle
  598. * @param strKey [IN] Key value, for example, using "Width" to get width
  599. * @param pstIntValue [IN][OUT] Structure pointer of camera features
  600. * @return Success, return MV_OK. Failure, return error code
  601. * @remarks You can call this API to get the value of camera node with integer type after connecting the device. For strKey value, refer to MvCameraNode. All the node values of "IInteger" in the list can be obtained via this API. strKey corresponds to the Name column.
  602. ************************************************************************/
  603. MV_CAMCTRL_API int __stdcall MV_CC_GetIntValueEx(IN void* handle,IN const char* strKey,OUT MVCC_INTVALUE_EX *pstIntValue);
  604. /********************************************************************//**
  605. * @~chinese
  606. * @brief 设置Integer型属性值
  607. * @param handle [IN] 设备句柄
  608. * @param strKey [IN] 属性键值,如获取宽度信息则为"Width"
  609. * @param nValue [IN] 想要设置的设备的属性值
  610. * @return 成功,返回MV_OK,失败,返回错误码
  611. * @remarks 连接设备之后调用该接口可以设置int类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IInteger”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
  612. * @~english
  613. * @brief Set Integer value
  614. * @param handle [IN] Device handle
  615. * @param strKey [IN] Key value, for example, using "Width" to set width
  616. * @param nValue [IN] Feature value to set
  617. * @return Success, return MV_OK. Failure, return error code
  618. * @remarks You can call this API to get the value of camera node with integer type after connecting the device. For strKey value, refer to MvCameraNode. All the node values of "IInteger" in the list can be obtained via this API. strKey corresponds to the Name column.
  619. ************************************************************************/
  620. MV_CAMCTRL_API int __stdcall MV_CC_SetIntValueEx(IN void* handle,IN const char* strKey,IN int64_t nValue);
  621. /********************************************************************//**
  622. * @~chinese
  623. * @brief 获取Enum属性值
  624. * @param handle [IN] 设备句柄
  625. * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
  626. * @param pstEnumValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  627. * @return 成功,返回MV_OK,失败,返回错误码
  628. * @remarks 连接设备之后调用该接口可以获取Enum类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IEnumeration”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
  629. * @~english
  630. * @brief Get Enum value
  631. * @param handle [IN] Device handle
  632. * @param strKey [IN] Key value, for example, using "PixelFormat" to get pixel format
  633. * @param pstEnumValue [IN][OUT] Structure pointer of camera features
  634. * @return Success, return MV_OK. Failure, return error code
  635. * @remarks After the device is connected, call this interface to get specified Enum nodes. For value of strKey, see MvCameraNode, The node values of IEnumeration can be obtained through this interface, strKey value corresponds to the Name column.
  636. ************************************************************************/
  637. MV_CAMCTRL_API int __stdcall MV_CC_GetEnumValue(IN void* handle,IN const char* strKey,OUT MVCC_ENUMVALUE *pstEnumValue);
  638. /********************************************************************//**
  639. * @~chinese
  640. * @brief 设置Enum型属性值
  641. * @param handle [IN] 设备句柄
  642. * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
  643. * @param nValue [IN] 想要设置的设备的属性值
  644. * @return 成功,返回MV_OK,失败,返回错误码
  645. * @remarks 连接设备之后调用该接口可以设置Enum类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IEnumeration”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
  646. * @~english
  647. * @brief Set Enum value
  648. * @param handle [IN] Device handle
  649. * @param strKey [IN] Key value, for example, using "PixelFormat" to set pixel format
  650. * @param nValue [IN] Feature value to set
  651. * @return Success, return MV_OK. Failure, return error code
  652. * @remarks After the device is connected, call this interface to get specified Enum nodes. For value of strKey, see MvCameraNode, The node values of IEnumeration can be obtained through this interface, strKey value corresponds to the Name column.
  653. ************************************************************************/
  654. MV_CAMCTRL_API int __stdcall MV_CC_SetEnumValue(IN void* handle,IN const char* strKey,IN unsigned int nValue);
  655. /********************************************************************//**
  656. * @~chinese
  657. * @brief 设置Enum型属性值
  658. * @param handle [IN] 设备句柄
  659. * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
  660. * @param strValue [IN] 想要设置的设备的属性字符串
  661. * @return 成功,返回MV_OK,失败,返回错误码
  662. * @remarks 连接设备之后调用该接口可以设置Enum类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IEnumeration”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
  663. * @~english
  664. * @brief Set Enum value
  665. * @param handle [IN] Device handle
  666. * @param strKey [IN] Key value, for example, using "PixelFormat" to set pixel format
  667. * @param strValue [IN] Feature String to set
  668. * @return Success, return MV_OK. Failure, return error code
  669. * @remarks Call this API after connecting the device. All the values of nodes with IEnumeration type can be set via this API.
  670. ************************************************************************/
  671. MV_CAMCTRL_API int __stdcall MV_CC_SetEnumValueByString(IN void* handle,IN const char* strKey,IN const char* strValue);
  672. /********************************************************************//**
  673. * @~chinese
  674. * @brief 获取Float属性值
  675. * @param handle [IN] 设备句柄
  676. * @param strKey [IN] 属性键值
  677. * @param pstFloatValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  678. * @return 成功,返回MV_OK,失败,返回错误码
  679. * @remarks 连接设备之后调用该接口可以获取float类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IFloat”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
  680. * @~english
  681. * @brief Get Float value
  682. * @param handle [IN] Device handle
  683. * @param strKey [IN] Key value
  684. * @param pstFloatValue [IN][OUT] Structure pointer of camera features
  685. * @return Success, return MV_OK. Failure, return error code
  686. * @remarks After the device is connected, call this interface to get specified float node. For detailed strKey value see: MvCameraNode. The node values of IFloat can be obtained through this interface, strKey value corresponds to the Name column.
  687. ************************************************************************/
  688. MV_CAMCTRL_API int __stdcall MV_CC_GetFloatValue(IN void* handle,IN const char* strKey,OUT MVCC_FLOATVALUE *pstFloatValue);
  689. /********************************************************************//**
  690. * @~chinese
  691. * @brief 设置float型属性值
  692. * @param handle [IN] 设备句柄
  693. * @param strKey [IN] 属性键值
  694. * @param fValue [IN] 想要设置的设备的属性值
  695. * @return 成功,返回MV_OK,失败,返回错误码
  696. * @remarks 连接设备之后调用该接口可以设置float类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IFloat”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
  697. * @~english
  698. * @brief Set float value
  699. * @param handle [IN] Device handle
  700. * @param strKey [IN] Key value
  701. * @param fValue [IN] Feature value to set
  702. * @return Success, return MV_OK. Failure, return error code
  703. * @remarks After the device is connected, call this interface to set specified float node. For detailed strKey value see: MvCameraNode. The node values of IFloat can be set through this interface, strKey value corresponds to the Name column.
  704. ************************************************************************/
  705. MV_CAMCTRL_API int __stdcall MV_CC_SetFloatValue(IN void* handle,IN const char* strKey,IN float fValue);
  706. /********************************************************************//**
  707. * @~chinese
  708. * @brief 获取Boolean属性值
  709. * @param handle [IN] 设备句柄
  710. * @param strKey [IN] 属性键值
  711. * @param pbValue [IN][OUT] 返回给调用者有关设备属性值
  712. * @return 成功,返回MV_OK,失败,返回错误码
  713. * @remarks 连接设备之后调用该接口可以获取bool类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IBoolean”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
  714. * @~english
  715. * @brief Get Boolean value
  716. * @param handle [IN] Device handle
  717. * @param strKey [IN] Key value
  718. * @param pbValue [IN][OUT] Structure pointer of camera features
  719. * @return Success, return MV_OK. Failure, return error code
  720. * @remarks After the device is connected, call this interface to get specified bool nodes. For value of strKey, see MvCameraNode. The node values of IBoolean can be obtained through this interface, strKey value corresponds to the Name column.
  721. ************************************************************************/
  722. MV_CAMCTRL_API int __stdcall MV_CC_GetBoolValue(IN void* handle,IN const char* strKey,OUT bool *pbValue);
  723. /********************************************************************//**
  724. * @~chinese
  725. * @brief 设置Boolean型属性值
  726. * @param handle [IN] 设备句柄
  727. * @param strKey [IN] 属性键值
  728. * @param bValue [IN] 想要设置的设备的属性值
  729. * @return 成功,返回MV_OK,失败,返回错误码
  730. * @remarks 连接设备之后调用该接口可以设置bool类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IBoolean”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
  731. * @~english
  732. * @brief Set Boolean value
  733. * @param handle [IN] Device handle
  734. * @param strKey [IN] Key value
  735. * @param bValue [IN] Feature value to set
  736. * @return Success, return MV_OK. Failure, return error code
  737. * @remarks After the device is connected, call this interface to set specified bool nodes. For value of strKey, see MvCameraNode. The node values of IBoolean can be set through this interface, strKey value corresponds to the Name column.
  738. ************************************************************************/
  739. MV_CAMCTRL_API int __stdcall MV_CC_SetBoolValue(IN void* handle,IN const char* strKey,IN bool bValue);
  740. /********************************************************************//**
  741. * @~chinese
  742. * @brief 获取String属性值
  743. * @param handle [IN] 设备句柄
  744. * @param strKey [IN] 属性键值
  745. * @param pstStringValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  746. * @return 成功,返回MV_OK,失败,返回错误码
  747. * @remarks 连接设备之后调用该接口可以获取string类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IString”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
  748. * @~english
  749. * @brief Get String value
  750. * @param handle [IN] Device handle
  751. * @param strKey [IN] Key value
  752. * @param pstStringValue [IN][OUT] Structure pointer of camera features
  753. * @return Success, return MV_OK. Failure, return error code
  754. * @remarks After the device is connected, call this interface to get specified string nodes. For value of strKey, see MvCameraNode. The node values of IString can be obtained through this interface, strKey value corresponds to the Name column.
  755. ************************************************************************/
  756. MV_CAMCTRL_API int __stdcall MV_CC_GetStringValue(IN void* handle,IN const char* strKey,OUT MVCC_STRINGVALUE *pstStringValue);
  757. /********************************************************************//**
  758. * @~chinese
  759. * @brief 设置String型属性值
  760. * @param handle [IN] 设备句柄
  761. * @param strKey [IN] 属性键值
  762. * @param strValue [IN] 想要设置的设备的属性值
  763. * @return 成功,返回MV_OK,失败,返回错误码
  764. * @remarks 连接设备之后调用该接口可以设置string类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IString”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
  765. * @~english
  766. * @brief Set String value
  767. * @param handle [IN] Device handle
  768. * @param strKey [IN] Key value
  769. * @param strValue [IN] Feature value to set
  770. * @return Success, return MV_OK. Failure, return error code
  771. * @remarks After the device is connected, call this interface to set specified string nodes. For value of strKey, see MvCameraNode. The node values of IString can be set through this interface, strKey value corresponds to the Name column.
  772. ************************************************************************/
  773. MV_CAMCTRL_API int __stdcall MV_CC_SetStringValue(IN void* handle,IN const char* strKey,IN const char* strValue);
  774. /********************************************************************//**
  775. * @~chinese
  776. * @brief 设置Command型属性值
  777. * @param handle [IN] 设备句柄
  778. * @param strKey [IN] 属性键值
  779. * @return 成功,返回MV_OK,失败,返回错误码
  780. * @remarks 连接设备之后调用该接口可以设置指定的Command类型节点。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“ICommand”的节点都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
  781. * @~english
  782. * @brief Send Command
  783. * @param handle [IN] Device handle
  784. * @param strKey [IN] Key value
  785. * @return Success, return MV_OK. Failure, return error code
  786. * @remarks After the device is connected, call this interface to set specified Command nodes. For value of strKey, see MvCameraNode. The node values of ICommand can be set through this interface, strKey value corresponds to the Name column.
  787. ************************************************************************/
  788. MV_CAMCTRL_API int __stdcall MV_CC_SetCommandValue(IN void* handle,IN const char* strKey);
  789. /********************************************************************//**
  790. * @~chinese
  791. * @brief 清除GenICam节点缓存
  792. * @param handle [IN] 设备句柄
  793. * @return 成功,返回MV_OK;错误,返回错误码
  794. * @~english
  795. * @brief Invalidate GenICam Nodes
  796. * @param handle [IN] Device handle
  797. * @return Success, return MV_OK. Failure, return error code
  798. ************************************************************************/
  799. MV_CAMCTRL_API int __stdcall MV_CC_InvalidateNodes(IN void* handle);
  800. /************************************************************************/
  801. /* 设备升级 和 寄存器读写 和异常、事件回调 */
  802. /* Device upgrade, register read and write and exception callback */
  803. /************************************************************************/
  804. /********************************************************************//**
  805. * @~chinese
  806. * @brief 设备本地升级
  807. * @param handle [IN] 设备句柄
  808. * @param strFilePathName [IN] 文件名
  809. * @return 成功,返回MV_OK,失败,返回错误码
  810. * @remarks 通过该接口可以将升级固件文件发送给设备进行升级。该接口需要等待升级固件文件成功传给设备端之后再返回,响应时间可能较长。
  811. * @~english
  812. * @brief Device Local Upgrade
  813. * @param handle [IN] Device handle
  814. * @param strFilePathName [IN] File name
  815. * @return Success, return MV_OK. Failure, return error code
  816. * @remarks Call this API to send the upgrade firmware to the device for upgrade. This API will wait for return until the upgrade firmware is sent to the device, this response may take a long time. \n
  817. For CameraLink device, it keeps sending upgrade firmware continuously.
  818. ************************************************************************/
  819. MV_CAMCTRL_API int __stdcall MV_CC_LocalUpgrade(IN void* handle, const void* strFilePathName);
  820. /********************************************************************//**
  821. * @~chinese
  822. * @brief 获取升级进度
  823. * @param handle [IN] 设备句柄
  824. * @param pnProcess [OUT] 进度接收地址
  825. * @return 成功,返回MV_OK,失败,返回错误码
  826. * @~english
  827. * @brief Get Upgrade Progress
  828. * @param handle [IN] Device handle
  829. * @param pnProcess [OUT] Progress receiving address
  830. * @return Success, return MV_OK. Failure, return error code
  831. ************************************************************************/
  832. MV_CAMCTRL_API int __stdcall MV_CC_GetUpgradeProcess(IN void* handle, unsigned int* pnProcess);
  833. /********************************************************************//**
  834. * @~chinese
  835. * @brief 读内存
  836. * @param handle [IN] 设备句柄
  837. * @param pBuffer [IN][OUT] 作为返回值使用,保存读到的内存值(GEV设备内存值是按照大端模式存储的,其它协议设备按照小端存储)
  838. * @param nAddress [IN] 待读取的内存地址,该地址可以从设备的Camera.xml文件中获取,形如xxx_RegAddr的xml节点值
  839. * @param nLength [IN] 待读取的内存长度
  840. * @return 成功,返回MV_OK,失败,返回错误码
  841. * @remarks 访问设备,读取某段寄存器的数据。
  842. * @~english
  843. * @brief Read Memory
  844. * @param handle [IN] Device Handle
  845. * @param pBuffer [IN][OUT] Used as a return value, save the read-in memory value ( Memory value is stored in accordance with the big end model)
  846. * @param nAddress [IN] Memory address to be read, which can be obtained from the Camera.xml file of the device, the form xml node value of xxx_RegAddr
  847. * @param nLength [IN] Length of the memory to be read
  848. * @return Success, return MV_OK. Failure, return error code
  849. * @remarks Access device, read the data from certain register.
  850. *************************************************************************/
  851. MV_CAMCTRL_API int __stdcall MV_CC_ReadMemory(IN void* handle , void *pBuffer, int64_t nAddress, int64_t nLength);
  852. /********************************************************************//**
  853. * @~chinese
  854. * @brief 写内存
  855. * @param handle [IN] 设备句柄
  856. * @param pBuffer [IN] 待写入的内存值(注意GEV设备内存值要按照大端模式存储,其它协议设备按照小端存储)
  857. * @param nAddress [IN] 待写入的内存地址,该地址可以从设备的Camera.xml文件中获取,形如xxx_RegAddr的xml节点值
  858. * @param nLength [IN] 待写入的内存长度
  859. * @return 成功,返回MV_OK,失败,返回错误码
  860. * @remarks 访问设备,把一段数据写入某段寄存器。
  861. * @~english
  862. * @brief Write Memory
  863. * @param handle [IN] Device Handle
  864. * @param pBuffer [IN] Memory value to be written ( Note the memory value to be stored in accordance with the big end model)
  865. * @param nAddress [IN] Memory address to be written, which can be obtained from the Camera.xml file of the device, the form xml node value of xxx_RegAddr
  866. * @param nLength [IN] Length of the memory to be written
  867. * @return Success, return MV_OK. Failure, return error code
  868. * @remarks Access device, write a piece of data into a certain segment of register.
  869. ************************************************************************/
  870. MV_CAMCTRL_API int __stdcall MV_CC_WriteMemory(IN void* handle, const void *pBuffer, int64_t nAddress, int64_t nLength);
  871. /********************************************************************//**
  872. * @~chinese
  873. * @brief 注册异常消息回调,在打开设备之后调用
  874. * @param handle [IN] 设备句柄
  875. * @param cbException [IN] 异常回调函数指针
  876. * @param pUser [IN] 用户自定义变量
  877. * @return 成功,返回MV_OK,失败,返回错误码
  878. * @remarks 该接口需要在MV_CC_OpenDevice打开设备之后调用。设备异常断开连接后可以在回调里面获取到异常消息,GigE设备掉线之后需要先调用MV_CC_CloseDevice接口关闭设备,再调用MV_CC_OpenDevice接口重新打开设备。
  879. * @~english
  880. * @brief Register Exception Message CallBack, call after open device
  881. * @param handle [IN] Device handle
  882. * @param cbException [IN] Exception Message CallBack Function Pointer
  883. * @param pUser [IN] User defined variable
  884. * @return Success, return MV_OK. Failure, return error code
  885. * @remarks Call this interface after the device is opened by MV_CC_OpenDevice. When device is exceptionally disconnected, the exception message can be obtained from callback function. For Disconnected GigE device, first call MV_CC_CloseDevice to shut device, and then call MV_CC_OpenDevice to reopen the device.
  886. ************************************************************************/
  887. MV_CAMCTRL_API int __stdcall MV_CC_RegisterExceptionCallBack(IN void* handle,
  888. void(__stdcall* cbException)(unsigned int nMsgType, void* pUser), void* pUser);
  889. /********************************************************************//**
  890. * @~chinese
  891. * @brief 注册全部事件回调,在打开设备之后调用
  892. * @param handle [IN] 设备句柄
  893. * @param cbEvent [IN] 事件回调函数指针
  894. * @param pUser [IN] 用户自定义变量
  895. * @return 成功,返回MV_OK,失败,返回错误码
  896. * @remarks 通过该接口设置事件回调,可以在回调函数里面获取采集、曝光等事件信息。 \n
  897. 该接口不支持CameraLink设备。
  898. * @~english
  899. * @brief Register event callback, which is called after the device is opened
  900. * @param handle [IN] Device handle
  901. * @param cbEvent [IN] Event CallBack Function Pointer
  902. * @param pUser [IN] User defined variable
  903. * @return Success, return MV_OK. Failure, return error code
  904. * @remarks Call this API to set the event callback function to get the event information, e.g., acquisition, exposure, and so on. \n
  905. This API is not supported by CameraLink device.
  906. ************************************************************************/
  907. MV_CAMCTRL_API int __stdcall MV_CC_RegisterAllEventCallBack(void* handle, void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser), void* pUser);
  908. /********************************************************************//**
  909. * @~chinese
  910. * @brief 注册单个事件回调,在打开设备之后调用
  911. * @param handle [IN] 设备句柄
  912. * @param strEventName [IN] 事件名称
  913. * @param cbEvent [IN] 事件回调函数指针
  914. * @param pUser [IN] 用户自定义变量
  915. * @return 成功,返回MV_OK,失败,返回错误码
  916. * @remarks 通过该接口设置事件回调,可以在回调函数里面获取采集、曝光等事件信息。\n
  917. 该接口不支持CameraLink设备,仅支持"设备掉线"这一种事件。
  918. * @~english
  919. * @brief Register single event callback, which is called after the device is opened
  920. * @param handle [IN] Device handle
  921. * @param strEventName [IN] Event name
  922. * @param cbEvent [IN] Event CallBack Function Pointer
  923. * @param pUser [IN] User defined variable
  924. * @return Success, return MV_OK. Failure, return error code
  925. * @remarks Call this API to set the event callback function to get the event information, e.g., acquisition, exposure, and so on. \n
  926. This API is not supported by CameraLink device .
  927. ************************************************************************/
  928. MV_CAMCTRL_API int __stdcall MV_CC_RegisterEventCallBackEx(void* handle, const char* strEventName,
  929. void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser), void* pUser);
  930. /************************************************************************/
  931. /* GigEVision 设备独有的接口 */
  932. /* GigEVision device specific interface */
  933. /************************************************************************/
  934. /********************************************************************//**
  935. * @~chinese
  936. * @brief 强制IP
  937. * @param handle [IN] 设备句柄
  938. * @param nIP [IN] 设置的IP
  939. * @param nSubNetMask [IN] 子网掩码
  940. * @param nDefaultGateWay [IN] 默认网关
  941. * @return 成功,返回MV_OK,失败,返回错误码
  942. * @remarks 强制设置设备网络参数(包括IP、子网掩码、默认网关),强制设置之后将需要重新创建设备句柄,仅GigEVision设备支持。\n
  943. 如果设备为DHCP的状态,调用该接口强制设置设备网络参数之后设备将会重启。
  944. * @~english
  945. * @brief Force IP
  946. * @param handle [IN] Device handle
  947. * @param nIP [IN] IP to set
  948. * @param nSubNetMask [IN] Subnet mask
  949. * @param nDefaultGateWay [IN] Default gateway
  950. * @return Success, return MV_OK. Failure, return error code
  951. * @remarks Force setting camera network parameter (including IP address, subnet mask, default gateway). After forced setting, device handle should be created again. This function is only supported by GigEVision camera.\n
  952. If device is in DHCP status, after calling this API to force setting camera network parameter, the device will restart.
  953. ************************************************************************/
  954. MV_CAMCTRL_API int __stdcall MV_GIGE_ForceIpEx(IN void* handle, unsigned int nIP, unsigned int nSubNetMask, unsigned int nDefaultGateWay);
  955. /********************************************************************//**
  956. * @~chinese
  957. * @brief 配置IP方式
  958. * @param handle [IN] 设备句柄
  959. * @param nType [IN] IP类型,见MV_IP_CFG_x
  960. * @return 成功,返回MV_OK,失败,返回错误码
  961. * @remarks 发送命令设置设备的IP方式,如DHCP、LLA等,仅GigEVision设备支持。
  962. * @~english
  963. * @brief IP configuration method
  964. * @param handle [IN] Device handle
  965. * @param nType [IN] IP type, refer to MV_IP_CFG_x
  966. * @return Success, return MV_OK. Failure, return error code
  967. * @remarks Send command to set camera IP mode, such as DHCP and LLA, only supported by GigEVision.
  968. ************************************************************************/
  969. MV_CAMCTRL_API int __stdcall MV_GIGE_SetIpConfig(IN void* handle, unsigned int nType);
  970. /********************************************************************//**
  971. * @~chinese
  972. * @brief 设置仅使用某种模式,type: MV_NET_TRANS_x,不设置时,默认优先使用driver
  973. * @param handle [IN] 设备句柄
  974. * @param nType [IN] 网络传输模式,见MV_NET_TRANS_x
  975. * @return 成功,返回MV_OK,失败,返回错误码
  976. * @remarks 通过该接口可以设置SDK内部优先使用的网络模式,默认优先使用驱动模式,仅GigEVision设备支持。
  977. * @~english
  978. * @brief Set to use only one mode,type: MV_NET_TRANS_x. When do not set, priority is to use driver by default
  979. * @param handle [IN] Device handle
  980. * @param nType [IN] Net transmission mode, refer to MV_NET_TRANS_x
  981. * @return Success, return MV_OK. Failure, return error code
  982. * @remarksSet SDK internal priority network mode through this interface, drive mode by default, only supported by GigEVision camera.
  983. ************************************************************************/
  984. MV_CAMCTRL_API int __stdcall MV_GIGE_SetNetTransMode(IN void* handle, unsigned int nType);
  985. /********************************************************************//**
  986. * @~chinese
  987. * @brief 获取网络传输信息
  988. * @param handle [IN] 设备句柄
  989. * @param pstInfo [OUT] 信息结构体
  990. * @return 成功,返回MV_OK,失败,返回错误码
  991. * @remarks 通过该接口可以获取网络传输相关信息,包括已接收数据大小、丢帧数量等,在MV_CC_StartGrabbing开启采集之后调用。仅GigEVision设备支持。
  992. * @~english
  993. * @brief Get net transmission information
  994. * @param handle [IN] Device handle
  995. * @param pstInfo [OUT] Information Structure
  996. * @return Success, return MV_OK. Failure, return error code
  997. * @remarks Get network transmission information through this API, including received data size, number of lost frames. Call this API after starting image acquiring through MV_CC_StartGrabbing. This API is supported only by GigEVision Camera.
  998. ************************************************************************/
  999. MV_CAMCTRL_API int __stdcall MV_GIGE_GetNetTransInfo(IN void* handle, MV_NETTRANS_INFO* pstInfo);
  1000. /********************************************************************//**
  1001. * @~chinese
  1002. * @brief 设置枚举命令的回复包类型
  1003. * @param nMode [IN] 回复包类型(默认广播),0-单播,1-广播
  1004. * @return 成功,返回MV_OK;错误,返回错误码
  1005. * @remarks 该接口只对GigE相机有效。
  1006. * @~english
  1007. * @brief Setting the ACK mode of devices Discovery.
  1008. * @param nMode [IN] ACK mode(Default-Broadcast),0-Unicast,1-Broadcast.
  1009. * @return Success, return MV_OK. Failure, return error code
  1010. * @remarks This interface is ONLY effective on GigE cameras. \n
  1011. ************************************************************************/
  1012. MV_CAMCTRL_API int __stdcall MV_GIGE_SetDiscoveryMode(unsigned int nMode);
  1013. /********************************************************************//**
  1014. * @~chinese
  1015. * @brief 设置GVSP取流超时时间
  1016. * @param handle [IN] 设备句柄
  1017. * @param nMillisec [IN] 超时时间,默认300ms,范围:>10ms
  1018. * @return 成功,返回MV_OK;错误,返回错误码
  1019. * @remarks 连接设备之后,取流动作发生前,调用该接口可以设置GVSP取流超时时间。GVSP取流超时设置过短可能造成图像异常,设置过长可能造成取流时间变长。
  1020. * @~english
  1021. * @brief Set GVSP streaming timeout
  1022. * @param handle [IN] Device handle
  1023. * @param nMillisec [IN] Timeout, default 300ms, range: >10ms
  1024. * @return Success, return MV_OK. Failure, return error code
  1025. * @remarks After the device is connected, and just before start streaming,
  1026. * call this interface to set GVSP streaming timeout value.
  1027. ************************************************************************/
  1028. MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvspTimeout(void* handle, unsigned int nMillisec);
  1029. /********************************************************************//**
  1030. * @~chinese
  1031. * @brief 获取GVSP取流超时时间
  1032. * @param handle [IN] 设备句柄
  1033. * @param pnMillisec [OUT] 超时时间指针,以毫秒位单位
  1034. * @return 成功,返回MV_OK;错误,返回错误码
  1035. * @remarks 该接口用于获取当前的GVSP取流超时时间
  1036. * @~english
  1037. * @brief Get GVSP streaming timeout
  1038. * @param handle [IN] Device handle
  1039. * @param pnMillisec [OUT] Timeout, ms as unit
  1040. * @return Success, return MV_OK. Failure, return error code
  1041. * @remarks This interface is used to get the current GVSP streaming timeout.
  1042. ************************************************************************/
  1043. MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvspTimeout(IN void* handle, unsigned int* pnMillisec);
  1044. /********************************************************************//**
  1045. * @~chinese
  1046. * @brief 设置GVCP命令超时时间
  1047. * @param handle [IN] 设备句柄
  1048. * @param nMillisec [IN] 超时时间,默认500ms,范围:0-10000ms
  1049. * @return 成功,返回MV_OK;错误,返回错误码
  1050. * @remarks 连接设备之后调用该接口可以设置GVCP命令超时时间。
  1051. * @~english
  1052. * @brief Set GVCP cammand timeout
  1053. * @param handle [IN] Device handle
  1054. * @param nMillisec [IN] Timeout, default 500ms, range: 0-10000ms
  1055. * @return Success, return MV_OK. Failure, return error code
  1056. * @remarks After the device is connected, call this interface to set GVCP command timeout time.
  1057. ************************************************************************/
  1058. MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvcpTimeout(void* handle, unsigned int nMillisec);
  1059. /********************************************************************//**
  1060. * @~chinese
  1061. * @brief 获取GVCP命令超时时间
  1062. * @param handle [IN] 设备句柄
  1063. * @param pnMillisec [OUT] 超时时间指针,以毫秒位单位
  1064. * @return 成功,返回MV_OK;错误,返回错误码
  1065. * @remarks 该接口用于获取当前的GVCP超时时间。
  1066. * @~english
  1067. * @brief Get GVCP cammand timeout
  1068. * @param handle [IN] Device handle
  1069. * @param pnMillisec [OUT] Timeout, ms as unit
  1070. * @return Success, return MV_OK. Failure, return error code
  1071. * @remarks This interface is used to get the current GVCP timeout.
  1072. ************************************************************************/
  1073. MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvcpTimeout(IN void* handle, unsigned int* pnMillisec);
  1074. /********************************************************************//**
  1075. * @~chinese
  1076. * @brief 设置重传GVCP命令次数
  1077. * @param handle [IN] 设备句柄
  1078. * @param nRetryGvcpTimes [IN] 重传次数,范围:0-100
  1079. * @return 成功,返回MV_OK;错误,返回错误码
  1080. * @remarks 该接口用于在GVCP包传输异常时,增加重传的次数,在一定程度上可以避免设备掉线,范围为0-100。
  1081. * @~english
  1082. * @brief Set the number of retry GVCP cammand
  1083. * @param handle [IN] Device handle
  1084. * @param nRetryGvcpTimes [IN] The number of retries,rang:0-100
  1085. * @return Success, return MV_OK. Failure, return error code
  1086. * @remarks This interface is used to increase The Times of retransmission when GVCP packet transmission is abnormal,and to some extent, it can avoid dropping the camera, with a range of 0-100.
  1087. ************************************************************************/
  1088. MV_CAMCTRL_API int __stdcall MV_GIGE_SetRetryGvcpTimes(IN void* handle, unsigned int nRetryGvcpTimes);
  1089. /********************************************************************//**
  1090. * @~chinese
  1091. * @brief 获取重传GVCP命令次数
  1092. * @param handle [IN] 设备句柄
  1093. * @param pnRetryGvcpTimes [OUT] 重传次数指针
  1094. * @return 成功,返回MV_OK;错误,返回错误码
  1095. * @remarks 该接口用于获取当前的GVCP重传次数,默认3次。
  1096. * @~english
  1097. * @brief Get the number of retry GVCP cammand
  1098. * @param handle [IN] Device handle
  1099. * @param pnRetryGvcpTimes [OUT] The number of retries
  1100. * @return Success, return MV_OK. Failure, return error code
  1101. * @remarks This interface is used to get the current number of GVCP retransmissions, which defaults to 3.
  1102. ************************************************************************/
  1103. MV_CAMCTRL_API int __stdcall MV_GIGE_GetRetryGvcpTimes(IN void* handle, unsigned int* pnRetryGvcpTimes);
  1104. /********************************************************************//**
  1105. * @~chinese
  1106. * @brief 获取最佳的packet size,该接口目前只支持GigE设备
  1107. * @param handle [IN] 设备句柄
  1108. * @return 最佳packetsize
  1109. * @remarks 获取最佳的packet size,对应GigEVision设备是SCPS,对应U3V设备是每次从驱动读取的包大小,该大小即网络上传输一个包的大小。该接口需要在MV_CC_OpenDevice之后、MV_CC_StartGrabbing之前调用。 \n
  1110. 该接口不支持CameraLink设备。
  1111. * @~english
  1112. * @brief Get the optimal Packet Size, Only support GigE Camera
  1113. * @param handle [IN] Device handle
  1114. * @return Optimal packetsize
  1115. * @remarks To get optimized packet size, for GigEVision device is SCPS, for USB3Vision device is the size of packet read from drive each time, and it is the size of a packet transported on the network. The interface should be called after MV_CC_OpenDevice and before MV_CC_StartGrabbing. \n
  1116. This API is not supported by CameraLink device.
  1117. ************************************************************************/
  1118. MV_CAMCTRL_API int __stdcall MV_CC_GetOptimalPacketSize(IN void* handle);
  1119. /********************************************************************//**
  1120. * @~chinese
  1121. * @brief 设置是否打开重发包支持,及重发包设置
  1122. * @param handle [IN] 设备句柄
  1123. * @param bEnable [IN] 是否支持重发包
  1124. * @param nMaxResendPercent [IN] 最大重发比
  1125. * @param nResendTimeout [IN] 重发超时时间
  1126. * @return 成功,返回MV_OK;错误,返回错误码
  1127. * @remarks 连接设备之后调用该接口可以设置重发包属性,仅GigEVision设备支持。
  1128. * @~english
  1129. * @brief Set whethe to enable resend, and set resend
  1130. * @param handle [IN] Device handle
  1131. * @param bEnable [IN] enable resend
  1132. * @param nMaxResendPercent [IN] Max resend persent
  1133. * @param nResendTimeout [IN] Resend timeout
  1134. * @return Success, return MV_OK. Failure, return error code
  1135. * @remarks After the device is connected, call this interface to set resend packet properties, only supported by GigEVision camera.
  1136. ************************************************************************/
  1137. #ifndef __cplusplus
  1138. MV_CAMCTRL_API int __stdcall MV_GIGE_SetResend(void* handle, unsigned int bEnable, unsigned int nMaxResendPercent, unsigned int nResendTimeout);
  1139. #else
  1140. MV_CAMCTRL_API int __stdcall MV_GIGE_SetResend(void* handle, unsigned int bEnable, unsigned int nMaxResendPercent = 10, unsigned int nResendTimeout = 50);
  1141. #endif
  1142. /********************************************************************//**
  1143. * @~chinese
  1144. * @brief 设置重传命令最大尝试次数
  1145. * @param handle [IN] 设备句柄
  1146. * @param nRetryTimes [IN] 重传命令最大尝试次数,默认20
  1147. * @return 成功,返回MV_OK;错误,返回错误码
  1148. * @remarks 该接口必须在调用MV_GIGE_SetResend开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER
  1149. * @~english
  1150. * @brief set the max resend retry times
  1151. * @param handle [IN] Device handle
  1152. * @param nRetryTimes [IN] The max times to retry resending lost packets,default 20
  1153. * @return Success, return MV_OK. Failure, return error code
  1154. * @remarks This interface MUST be called after enabling resending lost packets by calling MV_GIGE_SetResend, \n
  1155. * otherwise would fail and return MV_E_CALLORDER.
  1156. ************************************************************************/
  1157. MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendMaxRetryTimes(void* handle, unsigned int nRetryTimes);
  1158. /********************************************************************//**
  1159. * @~chinese
  1160. * @brief 获取重传命令最大尝试次数
  1161. * @param handle [IN] 设备句柄
  1162. * @param pnRetryTimes [OUT] 重传命令最大尝试次数
  1163. * @return 成功,返回MV_OK;错误,返回错误码
  1164. * @remarks 该接口必须在调用MV_GIGE_SetResend开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER
  1165. * @~english
  1166. * @brief get the max resend retry times
  1167. * @param handle [IN] Device handle
  1168. * @param pnRetryTimes [OUT] The max times to retry resending lost packets
  1169. * @return Success, return MV_OK. Failure, return error code
  1170. * @remarks This interface MUST be called after enabling resending lost packets by calling MV_GIGE_SetResend, \n
  1171. * otherwise would fail and return MV_E_CALLORDER.
  1172. ************************************************************************/
  1173. MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendMaxRetryTimes(void* handle, unsigned int* pnRetryTimes);
  1174. /********************************************************************//**
  1175. * @~chinese
  1176. * @brief 设置同一重传包多次请求之间的时间间隔
  1177. * @param handle [IN] 设备句柄
  1178. * @param nMillisec [IN] 同一重传包多次请求之间的时间间隔,默认10ms
  1179. * @return 成功,返回MV_OK;错误,返回错误码
  1180. * @remarks 该接口必须在调用MV_GIGE_SetResend开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER
  1181. * @~english
  1182. * @brief set time interval between same resend requests
  1183. * @param handle [IN] Device handle
  1184. * @param nMillisec [IN] The time interval between same resend requests,default 10ms
  1185. * @return Success, return MV_OK. Failure, return error code
  1186. * @remarks This interface MUST be called after enabling resending lost packets by calling MV_GIGE_SetResend, \n
  1187. * otherwise would fail and return MV_E_CALLORDER.
  1188. ************************************************************************/
  1189. MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendTimeInterval(void* handle, unsigned int nMillisec);
  1190. /********************************************************************//**
  1191. * @~chinese
  1192. * @brief 获取同一重传包多次请求之间的时间间隔
  1193. * @param handle [IN] 设备句柄
  1194. * @param pnMillisec [OUT] 同一重传包多次请求之间的时间间隔
  1195. * @return 成功,返回MV_OK;错误,返回错误码
  1196. * @remarks 该接口必须在调用MV_GIGE_SetResend开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER
  1197. * @~english
  1198. * @brief get time interval between same resend requests
  1199. * @param handle [IN] Device handle
  1200. * @param pnMillisec [OUT] The time interval between same resend requests
  1201. * @return Success, return MV_OK. Failure, return error code
  1202. * @remarks This interface MUST be called after enabling resending lost packets by calling MV_GIGE_SetResend, \n
  1203. * otherwise would fail and return MV_E_CALLORDER.
  1204. ************************************************************************/
  1205. MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendTimeInterval(void* handle, unsigned int* pnMillisec);
  1206. /********************************************************************//**
  1207. * @~chinese
  1208. * @brief 设置传输模式,可以为单播模式、组播模式等
  1209. * @param handle [IN] 设备句柄
  1210. * @param stTransmissionType [IN] 传输模式结构体
  1211. * @return 成功,返回MV_OK;错误,返回错误码
  1212. * @remarks 通过该接口可以设置传输模式为单播、组播等模式,仅GigEVision设备支持。
  1213. * @~english
  1214. * @brief Set transmission type,Unicast or Multicast
  1215. * @param handle [IN] Device handle
  1216. * @param stTransmissionType [IN] Struct of transmission type
  1217. * @return Success, return MV_OK. Failure, return error code
  1218. * @remarks Call this API to set the transmission mode as single cast mode and multicast mode. And this API is only valid for GigEVision camera.
  1219. ************************************************************************/
  1220. MV_CAMCTRL_API int __stdcall MV_GIGE_SetTransmissionType(void* handle, MV_TRANSMISSION_TYPE * pstTransmissionType);
  1221. /********************************************************************//**
  1222. * @~chinese
  1223. * @brief 发出动作命令
  1224. * @param pstActionCmdInfo [IN] 动作命令信息
  1225. * @param pstActionCmdResults [OUT] 动作命令返回信息列表
  1226. * @return 成功,返回MV_OK;错误,返回错误码
  1227. * @remarks 仅GigEVision设备支持。
  1228. * @~english
  1229. * @brief Issue Action Command
  1230. * @param pstActionCmdInfo [IN] Action Command
  1231. * @param pstActionCmdResults [OUT] Action Command Result List
  1232. * @return Success, return MV_OK. Failure, return error code
  1233. * @remarks This API is supported only by GigEVision camera.
  1234. ************************************************************************/
  1235. MV_CAMCTRL_API int __stdcall MV_GIGE_IssueActionCommand(IN MV_ACTION_CMD_INFO* pstActionCmdInfo, OUT MV_ACTION_CMD_RESULT_LIST* pstActionCmdResults);
  1236. /********************************************************************//**
  1237. * @~chinese
  1238. * @brief 获取组播状态
  1239. * @param pstDevInfo [IN] 设备信息结构体
  1240. * @param pbStatus [OUT] 组播状态,true:组播状态,false:非组播
  1241. * @return 成功,返回MV_OK;错误,返回错误码
  1242. * @remarks 该接口用于判断设备当前是否处于组播状态,解决客户端枚举时需要打开设备判断组播的问题。
  1243. * @~english
  1244. * @brief Get Multicast Status
  1245. * @param pstDevInfo [IN] Device Information Structure
  1246. * @param pbStatus [OUT] Status of Multicast
  1247. * @return Success, return MV_OK. Failure, return error code
  1248. * @remarks This interface is used to determine whether the camera is currently in multicast state, and to solve the problem that the client needs to turn on the camera to determine multicast when enumerating.
  1249. ************************************************************************/
  1250. MV_CAMCTRL_API int __stdcall MV_GIGE_GetMulticastStatus(IN MV_CC_DEVICE_INFO* pstDevInfo, OUT bool* pbStatus);
  1251. /************************************************************************/
  1252. /* CameraLink 设备独有的接口 */
  1253. /************************************************************************/
  1254. /********************************************************************//**
  1255. * @~chinese
  1256. * @brief 设置设备波特率
  1257. * @param handle [IN] 设备句柄
  1258. * @param nBaudrate [IN] 设置的波特率值,数值参考CameraParams.h中宏定义,如#define MV_CAML_BAUDRATE_9600 0x00000001
  1259. * @return 成功,返回MV_OK,失败,返回错误码
  1260. * @remarks 该接口支持在设备未连接时调用。
  1261. * @~english
  1262. * @brief Set device baudrate using one of the CL_BAUDRATE_XXXX value
  1263. * @param handle [IN] Device handle
  1264. * @param nBaudrate [IN] baud rate to set. Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001
  1265. * @return Success, return MV_OK. Failure, return error code
  1266. * @remarks This API is supported only by CameraLink device.\n
  1267. This API support calls when devices are not connected.
  1268. ************************************************************************/
  1269. MV_CAMCTRL_API int __stdcall MV_CAML_SetDeviceBaudrate(IN void* handle, unsigned int nBaudrate);
  1270. /********************************************************************//**
  1271. * @~chinese
  1272. * @brief 获取设备波特率
  1273. * @param handle [IN] 设备句柄
  1274. * @param pnCurrentBaudrate [OUT] 波特率信息指针,数值参考CameraParams.h中宏定义,如#define MV_CAML_BAUDRATE_9600 0x00000001
  1275. * @return 成功,返回MV_OK,失败,返回错误码
  1276. * @remarks 该接口支持在设备未连接时调用。
  1277. * @~english
  1278. * @brief Returns the current device baudrate, using one of the CL_BAUDRATE_XXXX value
  1279. * @param handle [IN] Device handle
  1280. * @param pnCurrentBaudrate [OUT] Return pointer of baud rate to user. Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001
  1281. * @return Success, return MV_OK. Failure, return error code
  1282. * @remarks This API is supported only by CameraLink device.\n
  1283. This API support calls when devices are not connected.
  1284. ************************************************************************/
  1285. MV_CAMCTRL_API int __stdcall MV_CAML_GetDeviceBaudrate(IN void* handle,unsigned int* pnCurrentBaudrate);
  1286. /********************************************************************//**
  1287. * @~chinese
  1288. * @brief 获取设备与主机间连接支持的波特率
  1289. * @param handle [IN] 设备句柄
  1290. * @param pnBaudrateAblity [OUT] 支持的波特率信息的指针。所支持波特率的或运算结果,单个数值参考CameraParams.h中宏定义,如MV_CAML_BAUDRATE_9600 0x00000001
  1291. * @return 成功,返回MV_OK,失败,返回错误码
  1292. * @remarks 该接口支持在设备未连接时调用。
  1293. * @~english
  1294. * @brief Returns supported baudrates of the combined device and host interface
  1295. * @param handle [IN] Device handle
  1296. * @param pnBaudrateAblity [OUT] Return pointer of the supported baudrates to user. 'OR' operation results of the supported baudrates. Refer to the 'CameraParams.h' for single value definitions, for example, MV_CAML_BAUDRATE_9600 0x00000001
  1297. * @return Success, return MV_OK. Failure, return error code
  1298. * @remarks This API is supported only by CameraLink device.\n
  1299. This API support calls when devices are not connected.
  1300. ************************************************************************/
  1301. MV_CAMCTRL_API int __stdcall MV_CAML_GetSupportBaudrates(IN void* handle,unsigned int* pnBaudrateAblity);
  1302. /********************************************************************//**
  1303. * @~chinese
  1304. * @brief 设置串口操作等待时长
  1305. * @param handle [IN] 设备句柄
  1306. * @param nMillisec [IN] 串口操作的等待时长, 单位为ms
  1307. * @return 成功,返回MV_OK,失败,返回错误码
  1308. * @~english
  1309. * @brief Sets the timeout for operations on the serial port
  1310. * @param handle [IN] Device handle
  1311. * @param nMillisec [IN] Timeout in [ms] for operations on the serial port.
  1312. * @return Success, return MV_OK. Failure, return error code
  1313. ************************************************************************/
  1314. MV_CAMCTRL_API int __stdcall MV_CAML_SetGenCPTimeOut(IN void* handle, unsigned int nMillisec);
  1315. /************************************************************************/
  1316. /* U3V 设备独有的接口 */
  1317. /************************************************************************/
  1318. /********************************************************************//**
  1319. * @~chinese
  1320. * @brief 设置U3V的传输包大小
  1321. * @param handle [IN] 设备句柄
  1322. * @param nTransferSize [IN] 传输的包大小, Byte,默认为1M,rang:>=0x10000
  1323. * @return 成功,返回MV_OK,失败,返回错误码
  1324. * @remarks 增加传输包大小可以适当降低取流时的CPU占用率。但不同的PC和不同USB扩展卡存在不同的兼容性,如果该参数设置过大可能会出现取不到图像的风险。
  1325. * @~english
  1326. * @brief Set transfer size of U3V device
  1327. * @param handle [IN] Device handle
  1328. * @param nTransferSize [IN] Transfer size,Byte,default:1M,rang:>=0x10000
  1329. * @return Success, return MV_OK. Failure, return error code
  1330. * @remarks Increasing the transmission packet size can reduce the CPU utilization at the time of fetching. However, different PCS and different USB extension CARDS have different compatibility, and if this parameter is set too large, there may be the risk of not getting the image.
  1331. ************************************************************************/
  1332. MV_CAMCTRL_API int __stdcall MV_USB_SetTransferSize(IN void* handle, unsigned int nTransferSize);
  1333. /********************************************************************//**
  1334. * @~chinese
  1335. * @brief 获取U3V的传输包大小
  1336. * @param handle [IN] 设备句柄
  1337. * @param pnTransferSize [OUT] 传输的包大小指针, Byte
  1338. * @return 成功,返回MV_OK,失败,返回错误码
  1339. * @remarks 该接口用于获取当前的U3V传输包大小,默认1M。
  1340. * @~english
  1341. * @brief Get transfer size of U3V device
  1342. * @param handle [IN] Device handle
  1343. * @param pnTransferSize [OUT] Transfer size,Byte
  1344. * @return Success, return MV_OK. Failure, return error code
  1345. * @remarks This interface is used to get the current U3V transfer packet size, default 1M.
  1346. ************************************************************************/
  1347. MV_CAMCTRL_API int __stdcall MV_USB_GetTransferSize(IN void* handle, unsigned int* pnTransferSize);
  1348. /********************************************************************//**
  1349. * @~chinese
  1350. * @brief 设置U3V的传输通道个数
  1351. * @param handle [IN] 设备句柄
  1352. * @param nTransferWays [IN] 传输通道个数,范围:1-10
  1353. * @return 成功,返回MV_OK,失败,返回错误码
  1354. * @remarks 用户可以根据PC的性能、设备出图帧率、图像大小和内存使用率等因素对该参数进行调节。但不同的PC和不同的USB扩展卡存在不同的兼容性。
  1355. * @~english
  1356. * @brief Set transfer ways of U3V device
  1357. * @param handle [IN] Device handle
  1358. * @param nTransferWays [IN] Transfer ways,rang:1-10
  1359. * @return Success, return MV_OK. Failure, return error code
  1360. * @remarks Users can adjust this parameter according to PC performance, camera image frame rate, image size, memory utilization and other factors. But different PCS and different USB expansion CARDS have different compatibility.
  1361. ************************************************************************/
  1362. MV_CAMCTRL_API int __stdcall MV_USB_SetTransferWays(IN void* handle, unsigned int nTransferWays);
  1363. /********************************************************************//**
  1364. * @~chinese
  1365. * @brief 获取U3V的传输通道个数
  1366. * @param handle [IN] 设备句柄
  1367. * @param pnTransferWays [OUT] 传输通道个数指针
  1368. * @return 成功,返回MV_OK,失败,返回错误码
  1369. * @remarks 该接口用于获取当前的U3V异步取流节点个数,2000W设备的MONO8默认为3个,YUV为默认2个,RGB为默认1个,其它情况默认8个节点。
  1370. * @~english
  1371. * @brief Get transfer ways of U3V device
  1372. * @param handle [IN] Device handle
  1373. * @param pnTransferWays [OUT] Transfer ways
  1374. * @return Success, return MV_OK. Failure, return error code
  1375. * @remarks This interface is used to get the current number of U3V asynchronous feed nodes. For 2000W camera, MONO8 defaults to 3, YUV defaults to 2, RGB defaults to 1, and other cases default to 8 nodes.
  1376. ************************************************************************/
  1377. MV_CAMCTRL_API int __stdcall MV_USB_GetTransferWays(IN void* handle, unsigned int* pnTransferWays);
  1378. /************************************************************************/
  1379. /* GenTL相关接口,其它接口可以复用(部分接口不支持) */
  1380. /************************************************************************/
  1381. /********************************************************************//**
  1382. * @~chinese
  1383. * @brief 通过GenTL枚举Interfaces
  1384. * @param pstIFList [OUT] Interfaces列表
  1385. * @param strGenTLPath [IN] GenTL的cti文件路径
  1386. * @return 成功,返回MV_OK;错误,返回错误码
  1387. * @remarks Interfaces列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,\n
  1388. 建议尽量避免多线程枚举操作。
  1389. * @~english
  1390. * @brief Enumerate Interfaces with GenTL
  1391. * @param pstIFList [OUT] Interfaces List
  1392. * @param strGenTLPath [IN] GenTL cti file path
  1393. * @return Success, return MV_OK. Failure, return error code
  1394. * @remarks The memory of the Interfaces list is allocated within the SDK. When the interface is invoked by multiple threads, the memory of the device list will be released and applied.\n
  1395. It is recommended to avoid multithreaded enumeration operations as much as possible.
  1396. ************************************************************************/
  1397. MV_CAMCTRL_API int __stdcall MV_CC_EnumInterfacesByGenTL(IN OUT MV_GENTL_IF_INFO_LIST* pstIFList, IN const char * strGenTLPath);
  1398. /********************************************************************//**
  1399. * @~chinese
  1400. * @brief 通过GenTL Interface枚举设备
  1401. * @param pstIFInfo [IN] Interface信息
  1402. * @param pstDevList [OUT] 设备列表
  1403. * @return 成功,返回MV_OK;错误,返回错误码
  1404. * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,\n
  1405. 建议尽量避免多线程枚举操作。
  1406. * @~english
  1407. * @brief Enumerate Devices with GenTL interface
  1408. * @param pstIFInfo [IN] Interface information
  1409. * @param pstDevList [OUT] Device List
  1410. * @return Success, return MV_OK. Failure, return error code
  1411. * @remarks The memory of the list is allocated within the SDK. When the interface is invoked by multiple threads, the memory of the device list will be released and applied.\n
  1412. It is recommended to avoid multithreaded enumeration operations as much as possible.
  1413. ************************************************************************/
  1414. MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesByGenTL(IN MV_GENTL_IF_INFO* pstIFInfo, IN OUT MV_GENTL_DEV_INFO_LIST* pstDevList);
  1415. /********************************************************************//**
  1416. * @~chinese
  1417. * @brief 卸载cti库
  1418. * @param pGenTLPath [IN] 枚举卡时加载的cti文件路径
  1419. * @return 成功,返回MV_OK;错误,返回错误码
  1420. * @remarks 卸载前需要保证通过该cti枚举出的相机已全部关闭,否则报错前置条件错误。
  1421. * @~english
  1422. * @brief Unload cti library
  1423. * @param pGenTLPath [IN] GenTL cti file path
  1424. * @return Success, return MV_OK. Failure, return error code
  1425. * @remarks Make sure that all devices enumerated by this cti are already closed.
  1426. ************************************************************************/
  1427. MV_CAMCTRL_API int __stdcall MV_CC_UnloadGenTLLibrary(IN const char * pGenTLPath);
  1428. /********************************************************************//**
  1429. * @~chinese
  1430. * @brief 通过GenTL设备信息创建设备句柄
  1431. * @param handle [OUT] 设备句柄
  1432. * @param pstDevInfo [IN] 设备信息结构体指针
  1433. * @return 成功,返回MV_OK;错误,返回错误码
  1434. * @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块。
  1435. * @~english
  1436. * @brief Create Device Handle with GenTL Device Info
  1437. * @param handle [OUT] Device handle
  1438. * @param pstDevInfo [IN] Device Information
  1439. * @return Success, return MV_OK. Failure, return error code
  1440. * @remarks Create required resources within library and initialize internal module according to input device information.
  1441. ************************************************************************/
  1442. MV_CAMCTRL_API int __stdcall MV_CC_CreateHandleByGenTL(OUT void ** handle, IN const MV_GENTL_DEV_INFO* pstDevInfo);
  1443. /************************************************************************/
  1444. /* XML解析树的生成 */
  1445. /* XML parse tree generation */
  1446. /************************************************************************/
  1447. /********************************************************************//**
  1448. * @~chinese
  1449. * @brief 获取设备属性树XML
  1450. * @param handle [IN] 设备句柄
  1451. * @param pData [OUT] XML数据接收缓存
  1452. * @param nDataSize [IN] 接收缓存大小
  1453. * @param pnDataLen [OUT] 实际数据大小
  1454. * @return 成功,返回MV_OK;错误,返回错误码
  1455. * @remarks 当pData为NULL或nDataSize比实际的xml文件小时,不拷贝数据,由pnDataLen返回xml文件大小;\n
  1456. 当pData为有效缓存地址,且缓存足够大时,拷贝完整数据保存在该缓存里面,并由pnDataLen返回xml文件实际大小。
  1457. * @~english
  1458. * @brief Get camera feature tree XML
  1459. * @param handle [IN] Device handle
  1460. * @param pData [OUT] XML data receiving buffer
  1461. * @param nDataSize [IN] Buffer size
  1462. * @param pnDataLen [OUT] Actual data length
  1463. * @return Success, return MV_OK. Failure, return error code
  1464. * @remarks When pData is NULL or nDataSize than the actual XML file hours, do not copy the data, returned by pnDataLen XML file size.\n
  1465. When pData is a valid cache address and the cache is large enough, copy the full data into the cache, and pnDataLen returns the actual size of the XML file.
  1466. ***********************************************************************/
  1467. MV_CAMCTRL_API int __stdcall MV_XML_GetGenICamXML(IN void* handle, IN OUT unsigned char* pData, IN unsigned int nDataSize, OUT unsigned int* pnDataLen);
  1468. /********************************************************************//**
  1469. * @~chinese
  1470. * @brief 获得当前节点的访问模式
  1471. * @param handle [IN] 设备句柄
  1472. * @param strName [IN] 节点名称
  1473. * @param penAccessMode [OUT] 节点的访问模式
  1474. * @return 成功,返回MV_OK;错误,返回错误码
  1475. * @~english
  1476. * @brief Get Access mode of cur node
  1477. * @param handle [IN] Device handle
  1478. * @param strName [IN] Name of node
  1479. * @param penAccessMode [OUT] Access mode of the node
  1480. * @return Success, return MV_OK. Failure, return error code
  1481. ***********************************************************************/
  1482. MV_CAMCTRL_API int __stdcall MV_XML_GetNodeAccessMode(IN void* handle, IN const char * strName, OUT MV_XML_AccessMode *penAccessMode);
  1483. /********************************************************************//**
  1484. * @~chinese
  1485. * @brief 获得当前节点的类型
  1486. * @param handle [IN] 设备句柄
  1487. * @param strName [IN] 节点名称
  1488. * @param penInterfaceType [OUT] 节点的类型
  1489. * @return 成功,返回MV_OK;错误,返回错误码
  1490. * @remarks 该接口可以在调用万能接口之前,提前知道节点类型,方便用户选择合适的万能接口进行节点值的设置和获取。
  1491. * @~english
  1492. * @brief Get Interface Type of cur node
  1493. * @param handle [IN] Device handle
  1494. * @param strName [IN] Name of node
  1495. * @param penInterfaceType [OUT] Interface Type of the node
  1496. * @return Success, return MV_OK. Failure, return error code
  1497. * @remarks The interface can know the node type in advance before calling the universal interface, so as to facilitate users to select the appropriate universal interface for setting and obtaining the node value.
  1498. ***********************************************************************/
  1499. MV_CAMCTRL_API int __stdcall MV_XML_GetNodeInterfaceType(IN void* handle, IN const char * strName, OUT MV_XML_InterfaceType *penInterfaceType);
  1500. /************************************************************************/
  1501. /* 附加接口 */
  1502. /* Additional interface */
  1503. /************************************************************************/
  1504. /********************************************************************//**
  1505. * @~chinese
  1506. * @brief 保存图片,支持Bmp和Jpeg.
  1507. * @param handle [IN] 设备句柄
  1508. * @param pstSaveParam [IN][OUT] 保存图片参数结构体
  1509. * @return 成功,返回MV_OK;错误,返回错误码
  1510. * @remarks 通过将接口可以将从设备采集到的原始图像数据转换成JPEG或者BMP等格式并存放在指定内存中,然后用户可以将转换之后的数据直接保存成图片文件。该接口调用无接口顺序要求,有图像源数据就可以进行转换,可以先调用MV_CC_GetOneFrameTimeout或者MV_CC_RegisterImageCallBackEx设置回调函数,获取一帧图像数据,然后再通过该接口转换格式。 \n
  1511. MV_CC_SaveImageEx2比MV_CC_SaveImageEx增加参数handle,为了保证与其他接口的统一。
  1512. * @~english
  1513. * @brief Save image, support Bmp and Jpeg.
  1514. * @param handle [IN] Device handle
  1515. * @param pstSaveParam [IN][OUT] Save image parameters structure
  1516. * @return Success, return MV_OK. Failure, return error code
  1517. * @remarks Once there is image data, you can call this API to convert the data. \n
  1518. You can also call MV_CC_GetOneFrameTimeout or MV_CC_RegisterImageCallBackEx or MV_CC_GetImageBuffer to get one image frame and set the callback function, and then call this API to convert the format. \n
  1519. Comparing with the API MV_CC_SaveImageEx, this API added the parameter handle to ensure the unity with other API.
  1520. ************************************************************************/
  1521. MV_CAMCTRL_API int __stdcall MV_CC_SaveImageEx2(IN void* handle, MV_SAVE_IMAGE_PARAM_EX* pstSaveParam);
  1522. /********************************************************************//**
  1523. * @~chinese
  1524. * @brief 保存图像到文件
  1525. * @param handle [IN] 设备句柄
  1526. * @param pstSaveFileParam [IN][OUT] 保存图片文件参数结构体
  1527. * @return 成功,返回MV_OK;错误,返回错误码
  1528. * @remarks 该接口支持BMP/JPEG/PNG/TIFF。
  1529. * @~english
  1530. * @brief Save the image file.
  1531. * @param handle [IN] Device handle
  1532. * @param pstSaveFileParam [IN][OUT] Save the image file parameter structure
  1533. * @return Success, return MV_OK. Failure, return error code
  1534. * @remarks This API support BMP/JPEG/PNG/TIFF.
  1535. ************************************************************************/
  1536. MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFile(IN void* handle, MV_SAVE_IMG_TO_FILE_PARAM* pstSaveFileParam);
  1537. /********************************************************************//**
  1538. * @~chinese
  1539. * @brief 保存3D点云数据,支持PLY、CSV和OBJ三种格式
  1540. * @param handle [IN] 设备句柄
  1541. * @param pstPointDataParam [IN][OUT] 保存点云数据参数结构体
  1542. * @return 成功,返回MV_OK;错误,返回错误码
  1543. * @remarks 3D数据格式保存成3D文件格式,支持PLY/CSV/OBJ,/n
  1544. 目前支持PixelType_Gvsp_Coord3D_ABC32、PixelType_Gvsp_Coord3D_ABC32f、PixelType_Gvsp_Coord3D_AB32、PixelType_Gvsp_Coord3D_AB32f、PixelType_Gvsp_Coord3D_AC32、PixelType_Gvsp_Coord3D_AC32f,暂不支持其他3D格式。
  1545. * @~english
  1546. * @brief Save 3D point data, support PLY、CSV and OBJ
  1547. * @param handle [IN] Device handle
  1548. * @param pstPointDataParam [IN][OUT] Save 3D point data parameters structure
  1549. * @return Success, return MV_OK. Failure, return error code
  1550. * @remarks Save the 3D data format to 3D file format,support PLY、CSV and OBJ,/n
  1551. only support PixelType_Gvsp_Coord3D_ABC32、PixelType_Gvsp_Coord3D_ABC32f、PixelType_Gvsp_Coord3D_AB32、PixelType_Gvsp_Coord3D_AB32f、PixelType_Gvsp_Coord3D_AC32、PixelType_Gvsp_Coord3D_AC32f,Other 3D format is not supported now.
  1552. ************************************************************************/
  1553. MV_CAMCTRL_API int __stdcall MV_CC_SavePointCloudData(IN void* handle, MV_SAVE_POINT_CLOUD_PARAM* pstPointDataParam);
  1554. /********************************************************************//**
  1555. * @~chinese
  1556. * @brief 图像旋转
  1557. * @param handle [IN] 设备句柄
  1558. * @param pstRotateParam [IN][OUT] 图像旋转参数结构体
  1559. * @return 成功,返回MV_OK;错误,返回错误码
  1560. * @remarks 该接口只支持MONO8/RGB24/BGR24格式数据的90/180/270度旋转。
  1561. * @~english
  1562. * @brief Rotate Image
  1563. * @param handle [IN] Device handle
  1564. * @param pstRotateParam [IN][OUT] Rotate image parameter structure
  1565. * @return Success, return MV_OK. Failure, return error code
  1566. * @remarks This API only support 90/180/270 rotation of data in the MONO8/RGB24/BGR24 format.
  1567. ************************************************************************/
  1568. MV_CAMCTRL_API int __stdcall MV_CC_RotateImage(IN void* handle, IN OUT MV_CC_ROTATE_IMAGE_PARAM* pstRotateParam);
  1569. /********************************************************************//**
  1570. * @~chinese
  1571. * @brief 图像翻转
  1572. * @param handle [IN] 设备句柄
  1573. * @param pstFlipParam [IN][OUT] 图像翻转参数结构体
  1574. * @return 成功,返回MV_OK;错误,返回错误码
  1575. * @remarks 该接口只支持MONO8/RGB24/BGR24格式数据的垂直和水平翻转。
  1576. * @~english
  1577. * @brief Flip Image
  1578. * @param handle [IN] Device handle
  1579. * @param pstFlipParam [IN][OUT] Flip image parameter structure
  1580. * @return Success, return MV_OK. Failure, return error code
  1581. * @remarks This API only support vertical and horizontal reverse of data in the MONO8/RGB24/BGR24 format.
  1582. ************************************************************************/
  1583. MV_CAMCTRL_API int __stdcall MV_CC_FlipImage(IN void* handle, IN OUT MV_CC_FLIP_IMAGE_PARAM* pstFlipParam);
  1584. /********************************************************************//**
  1585. * @~chinese
  1586. * @brief 像素格式转换
  1587. * @param handle [IN] 设备句柄
  1588. * @param pstCvtParam [IN][OUT] 像素格式转换参数结构体
  1589. * @return 成功,返回MV_OK;错误,返回错误码
  1590. * @remarks 通过将接口可以将从设备采集到的原始图像数据转换成用户所需的像素格式并存放在指定内存中。该接口调用无接口顺序要求,有图像源数据就可以进行转换,可以先调用MV_CC_GetOneFrameTimeout或者MV_CC_RegisterImageCallBackEx设置回调函数,获取一帧图像数据,然后再通过该接口转换格式。如果设备当前采集图像是JPEG压缩的格式,则不支持调用该接口进行转换。 \n
  1591. * @~english
  1592. * @brief Pixel format conversion
  1593. * @param handle [IN] Device handle
  1594. * @param pstCvtParam [IN][OUT] Convert Pixel Type parameter structure
  1595. * @return Success, return MV_OK. Failure, return error code
  1596. * @remarks This API is used to transform the collected original data to pixel format and save to specified memory. There is no order requirement to call this API, the transformation will execute when there is image data. First call MV_CC_GetOneFrameTimeout or MV_CC_RegisterImageCallBackEx to set callback function, and get a frame of image data, then call this API to transform the format. \n
  1597. ************************************************************************/
  1598. MV_CAMCTRL_API int __stdcall MV_CC_ConvertPixelType(IN void* handle, IN OUT MV_CC_PIXEL_CONVERT_PARAM* pstCvtParam);
  1599. /********************************************************************//**
  1600. * @~chinese
  1601. * @brief 设置插值算法类型
  1602. * @param handle [IN] 设备句柄
  1603. * @param nBayerCvtQuality [IN] Bayer的插值方法 0-快速 1-均衡 2-最优(默认为最优)
  1604. * @return 成功,返回MV_OK;错误,返回错误码
  1605. * @remarks 设置内部图像转换接口的Bayer插值算法类型参数,MV_CC_ConvertPixelType、MV_CC_GetImageForRGB/BGR接口内部使用的插值算法是该接口所设定的。
  1606. * @~english
  1607. * @brief Interpolation algorithm type setting
  1608. * @param handle [IN] Device handle
  1609. * @param nBayerCvtQuality [IN] Bayer interpolation method 0-Fast 1-Equilibrium 2-Optimal
  1610. * @return Success, return MV_OK. Failure, return error code
  1611. * @remarks Set the bell interpolation quality parameters of the internal image conversion interface, and the interpolation algorithm used in the MV_CC_ConvertPixelType and MV_CC_GetImageForRGB/BGR interfaces is set by this interface.
  1612. ************************************************************************/
  1613. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCvtQuality(IN void* handle, IN unsigned int nBayerCvtQuality);
  1614. /********************************************************************//**
  1615. * @~chinese
  1616. * @brief 设置Bayer格式的Gamma值
  1617. * @param handle [IN] 设备句柄
  1618. * @param fBayerGammaValue [IN] Gamma值[0.1,4.0]
  1619. * @return 成功,返回MV_OK;错误,返回错误码
  1620. * @remarks 设置该值后,在调用MV_CC_ConvertPixelType、MV_CC_SaveImageEx2接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时起效。
  1621. * @~english
  1622. * @brief Set Gamma value
  1623. * @param handle [IN] Device handle
  1624. * @param fBayerGammaValue [IN] Gamma value[0.1,4.0]
  1625. * @return Success, return MV_OK. Failure, return error code
  1626. * @remarks After setting the value, it work in the calling MV_CC_ConvertPixelType\MV_CC_SaveImageEx2 API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64.
  1627. ************************************************************************/
  1628. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaValue(IN void* handle, IN float fBayerGammaValue);
  1629. /********************************************************************//**
  1630. * @~chinese
  1631. * @brief 设置Bayer格式的Gamma信息
  1632. * @param handle [IN] 设备句柄
  1633. * @param pstGammaParam [IN] Gamma信息
  1634. * @return 成功,返回MV_OK;错误,返回错误码
  1635. * @remarks 设置该信息后,在调用MV_CC_ConvertPixelType、MV_CC_SaveImageEx2接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时起效。
  1636. * @~english
  1637. * @brief Set Gamma param
  1638. * @param handle [IN] Device handle
  1639. * @param pstGammaParam [IN] Gamma param
  1640. * @return Success, return MV_OK. Failure, return error code
  1641. * @remarks After setting the param, it work in the calling MV_CC_ConvertPixelType\MV_CC_SaveImageEx2 API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64.
  1642. ************************************************************************/
  1643. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaParam(IN void* handle, IN MV_CC_GAMMA_PARAM* pstGammaParam);
  1644. /********************************************************************//**
  1645. * @~chinese
  1646. * @brief 设置Bayer格式的CCM使能和矩阵,量化系数默认1024
  1647. * @param handle [IN] 设备句柄
  1648. * @param pstCCMParam [IN] CCM参数
  1649. * @return 成功,返回MV_OK;错误,返回错误码
  1650. * @remarks 开启CCM并设置CCM矩阵后,在调用MV_CC_ConvertPixelType、MV_CC_SaveImageEx2接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时起效。
  1651. * @~english
  1652. * @brief Set CCM param,Scale default 1024
  1653. * @param handle [IN] Device handle
  1654. * @param pstCCMParam [IN] CCM parameter structure
  1655. * @return Success, return MV_OK. Failure, return error code
  1656. * @remarks After enable the color correction and set the color correction matrix, It work in the calling MV_CC_ConvertPixelType\MV_CC_SaveImageEx2 API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64.
  1657. ************************************************************************/
  1658. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParam(IN void* handle, IN MV_CC_CCM_PARAM* pstCCMParam);
  1659. /********************************************************************//**
  1660. * @~chinese
  1661. * @brief 设置Bayer格式的CCM使能和矩阵
  1662. * @param handle [IN] 设备句柄
  1663. * @param pstCCMParam [IN] CCM参数
  1664. * @return 成功,返回MV_OK;错误,返回错误码
  1665. * @remarks 开启CCM并设置CCM矩阵后,在调用MV_CC_ConvertPixelType、MV_CC_SaveImageEx2接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时起效。
  1666. * @~english
  1667. * @brief Set CCM param
  1668. * @param handle [IN] Device handle
  1669. * @param pstCCMParam [IN] CCM parameter structure
  1670. * @return Success, return MV_OK. Failure, return error code
  1671. * @remarks After enable the color correction and set the color correction matrix, It work in the calling MV_CC_ConvertPixelType\MV_CC_SaveImageEx2 API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64.
  1672. ************************************************************************/
  1673. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParamEx(IN void* handle, IN MV_CC_CCM_PARAM_EX* pstCCMParam);
  1674. /********************************************************************//**
  1675. * @~chinese
  1676. * @brief 无损解码
  1677. * @param handle [IN] 设备句柄
  1678. * @param pstDecodeParam [IN][OUT] 无损解码参数结构体
  1679. * @return 成功,返回MV_OK;错误,返回错误码
  1680. * @remarks 将从相机中取到的无损压缩码流解码成裸数据,同时支持解析当前相机实时图像的水印信息(如果输入的无损码流不是当前相机或者不是实时取流的,则水印解析可能异常)
  1681. * @~english
  1682. * @brief High Bandwidth Decode
  1683. * @param handle [IN] Device handle
  1684. * @param pstDecodeParam [IN][OUT] High Bandwidth Decode parameter structure
  1685. * @return Success, return MV_OK. Failure, return error code
  1686. * @remarks Decode the lossless compressed data from the camera into raw data
  1687. ************************************************************************/
  1688. MV_CAMCTRL_API int __stdcall MV_CC_HB_Decode(IN void* handle, IN OUT MV_CC_HB_DECODE_PARAM* pstDecodeParam);
  1689. /********************************************************************//**
  1690. * @~chinese
  1691. * @brief 保存设备属性
  1692. * @param handle [IN] 设备句柄
  1693. * @param strFileName [IN] 属性文件名
  1694. * @return 成功,返回MV_OK;错误,返回错误码
  1695. * @~english
  1696. * @brief Save camera feature
  1697. * @param handle [IN] Device handle
  1698. * @param strFileName [IN] File name
  1699. * @return Success, return MV_OK. Failure, return error code
  1700. ************************************************************************/
  1701. MV_CAMCTRL_API int __stdcall MV_CC_FeatureSave(IN void* handle, IN const char* strFileName);
  1702. /********************************************************************//**
  1703. * @~chinese
  1704. * @brief 导入设备属性
  1705. * @param handle [IN] 设备句柄
  1706. * @param strFileName [IN] 属性文件名
  1707. * @return 成功,返回MV_OK;错误,返回错误码
  1708. * @~english
  1709. * @brief Load camera feature
  1710. * @param handle [IN] Device handle
  1711. * @param strFileName [IN] File name
  1712. * @return Success, return MV_OK. Failure, return error code
  1713. ************************************************************************/
  1714. MV_CAMCTRL_API int __stdcall MV_CC_FeatureLoad(IN void* handle, IN const char* strFileName);
  1715. /********************************************************************//**
  1716. * @~chinese
  1717. * @brief 从设备读取文件
  1718. * @param handle [IN] 设备句柄
  1719. * @param pstFileAccess [IN] 文件存取结构体
  1720. * @return 成功,返回MV_OK;错误,返回错误码
  1721. * @~english
  1722. * @brief Read the file from the camera
  1723. * @param handle [IN] Device handle
  1724. * @param pstFileAccess [IN] File access structure
  1725. * @return Success, return MV_OK. Failure, return error code
  1726. ************************************************************************/
  1727. MV_CAMCTRL_API int __stdcall MV_CC_FileAccessRead(IN void* handle, IN MV_CC_FILE_ACCESS * pstFileAccess);
  1728. /********************************************************************//**
  1729. * @~chinese
  1730. * @brief 将文件写入设备
  1731. * @param handle [IN] 设备句柄
  1732. * @param pstFileAccess [IN] 文件存取结构体
  1733. * @return 成功,返回MV_OK;错误,返回错误码
  1734. * @~english
  1735. * @brief Write the file to camera
  1736. * @param handle [IN] Device handle
  1737. * @param pstFileAccess [IN] File access structure
  1738. * @return Success, return MV_OK. Failure, return error code
  1739. ************************************************************************/
  1740. MV_CAMCTRL_API int __stdcall MV_CC_FileAccessWrite(IN void* handle, IN MV_CC_FILE_ACCESS * pstFileAccess);
  1741. /********************************************************************//**
  1742. * @~chinese
  1743. * @brief 获取文件存取的进度
  1744. * @param handle [IN] 设备句柄
  1745. * @param pstFileAccessProgress [IN] 进度内容
  1746. * @return 成功,返回MV_OK;错误,返回错误码 (当前文件存取的状态)
  1747. * @~english
  1748. * @brief Get File Access Progress
  1749. * @param handle [IN] Device handle
  1750. * @param pstFileAccessProgress [IN] File access Progress
  1751. * @return Success, return MV_OK. Failure, return error code
  1752. ************************************************************************/
  1753. MV_CAMCTRL_API int __stdcall MV_CC_GetFileAccessProgress(IN void* handle, OUT MV_CC_FILE_ACCESS_PROGRESS * pstFileAccessProgress);
  1754. /********************************************************************//**
  1755. * @~chinese
  1756. * @brief 开始录像
  1757. * @param handle [IN] 设备句柄
  1758. * @param pstRecordParam [IN] 录像参数结构体
  1759. * @return 成功,返回MV_OK;错误,返回错误码
  1760. * @~english
  1761. * @brief Start Record
  1762. * @param handle [IN] Device handle
  1763. * @param pstRecordParam [IN] Record param structure
  1764. * @return Success, return MV_OK. Failure, return error code
  1765. ************************************************************************/
  1766. MV_CAMCTRL_API int __stdcall MV_CC_StartRecord(IN void* handle, IN MV_CC_RECORD_PARAM* pstRecordParam);
  1767. /********************************************************************//**
  1768. * @~chinese
  1769. * @brief 输入录像数据
  1770. * @param handle [IN] 设备句柄
  1771. * @param pstInputFrameInfo [IN] 录像数据结构体
  1772. * @return 成功,返回MV_OK;错误,返回错误码
  1773. * @~english
  1774. * @brief Input RAW data to Record
  1775. * @param handle [IN] Device handle
  1776. * @param pstInputFrameInfo [IN] Record data structure
  1777. * @return Success, return MV_OK. Failure, return error code
  1778. ************************************************************************/
  1779. MV_CAMCTRL_API int __stdcall MV_CC_InputOneFrame(IN void* handle, IN MV_CC_INPUT_FRAME_INFO * pstInputFrameInfo);
  1780. /********************************************************************//**
  1781. * @~chinese
  1782. * @brief 停止录像
  1783. * @param handle [IN] 设备句柄
  1784. * @return 成功,返回MV_OK;错误,返回错误码
  1785. * @~english
  1786. * @brief Stop Record
  1787. * @param handle [IN] Device handle
  1788. * @return Success, return MV_OK. Failure, return error code
  1789. ************************************************************************/
  1790. MV_CAMCTRL_API int __stdcall MV_CC_StopRecord(IN void* handle);
  1791. #ifdef __cplusplus
  1792. }
  1793. #endif
  1794. #endif //_MV_CAMERA_CTRL_H_