MvCameraControl.h 177 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722
  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. #ifndef MV_CAMCTRL_API
  7. #if (defined (_WIN32) || defined(WIN64))
  8. #if defined(MV_CAMCTRL_EXPORTS)
  9. #define MV_CAMCTRL_API __declspec(dllexport)
  10. #else
  11. #define MV_CAMCTRL_API __declspec(dllimport)
  12. #endif
  13. #else
  14. #ifndef __stdcall
  15. #define __stdcall
  16. #endif
  17. #ifndef MV_CAMCTRL_API
  18. #define MV_CAMCTRL_API
  19. #endif
  20. #endif
  21. #endif
  22. #ifdef MV_CAMCTRL_API
  23. #if (defined (_WIN32) || defined(WIN64))
  24. #if defined(MV_CAMCTRL_EXPORTS)
  25. #define MV_CAMCTRL_API __declspec(dllexport)
  26. #else
  27. #define MV_CAMCTRL_API __declspec(dllimport)
  28. #endif
  29. #else
  30. #ifndef __stdcall
  31. #define __stdcall
  32. #endif
  33. #if defined(MV_CAMCTRL_EXPORTS)
  34. #define MV_CAMCTRL_API __attribute__((visibility("default")))
  35. #else
  36. #define MV_CAMCTRL_API
  37. #endif
  38. #endif
  39. #endif
  40. #ifndef IN
  41. #define IN
  42. #endif
  43. #ifndef OUT
  44. #define OUT
  45. #endif
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. /****************************** ch: 摘要 | en: Instructions**********************************************/
  50. /**
  51. * @~chinese
  52. * 该头文件主要包含11部分:
  53. * 1.SDK初始化
  54. * 2.相机的配置(枚举/打开/关闭)和取流接口
  55. * 3.采集卡的配置(枚举/打开/关闭)
  56. * 4.相机/采集卡属性万能配置接口&读写寄存器接口
  57. * 5.相机/采集卡 升级
  58. * 6.相机和采集卡 注册异常回调和事件接口
  59. * 7.仅GigE设备支持的接口
  60. * 8.仅CameraLink 设备支持的接口
  61. * 9.仅U3V设备支持的接口
  62. * 10.GenTL相关接口
  63. * 11.图像保存、格式转换等相关接口
  64. * @~english
  65. * The document mainly consists of 11 parts:
  66. * 1.SDK Initialization
  67. * 2.Camera control and streaming·
  68. * 3.Frame grabber control·
  69. * 4.Camera/Frame grabberattribute nodes set and obtained universal interface
  70. * 5.Camera/Frame grabber upgrade and read-write register memory interface
  71. * 6.Camera/Frame grabber Enrol abnormal callbacks and event interface
  72. * 7.Only support GigE device interface
  73. * 8.Only support camlink device interface
  74. * 9.Only support U3V device interface
  75. * 10.Only support GenTL device interface
  76. * 11.Related image save and format convert interface
  77. **/
  78. /**************************Part1 ch: SDK 初始化 | en: SDK Initialization ******************************************/
  79. /********************************************************************//**
  80. * @~chinese
  81. * @brief 初始化SDK
  82. * @return 成功,返回MV_OK;错误,返回错误码
  83. * @~english
  84. * @brief Initialize SDK
  85. * @return Success, return MV_OK. Failure, return error code
  86. ************************************************************************/
  87. MV_CAMCTRL_API int __stdcall MV_CC_Initialize();
  88. /********************************************************************//**
  89. * @~chinese
  90. * @brief 反初始化SDK,释放资源
  91. * @return 成功,返回MV_OK;错误,返回错误码
  92. * @remarks main函数退出前调用
  93. * @~english
  94. * @brief Terminate SDK
  95. * @return Success, return MV_OK. Failure, return error code
  96. * @remarks Called before the main function exits
  97. ************************************************************************/
  98. MV_CAMCTRL_API int __stdcall MV_CC_Finalize();
  99. /********************************************************************//**
  100. * @~chinese
  101. * @brief 获取SDK版本号
  102. * @return 返回4字节版本号
  103. |主 |次 |修正 | 测试|
  104. 8bits 8bits 8bits 8bits
  105. * @remarks 比如返回值为0x01000001,即SDK版本号为V1.0.0.1。
  106. * @~english
  107. * @brief Get SDK Version
  108. * @return Always return 4 Bytes of version number
  109. |Main |Sub |Rev | Test|
  110. 8bits 8bits 8bits 8bits
  111. * @remarks For example, if the return value is 0x01000001, the SDK version is V1.0.0.1.
  112. ************************************************************************/
  113. MV_CAMCTRL_API unsigned int __stdcall MV_CC_GetSDKVersion();
  114. /**************************Part2 ch: 相机的控制和取流 | en: Camera control and streaming******************************************/
  115. /********************************************************************//**
  116. * @~chinese
  117. * @brief 枚举设备
  118. * @param nTLayerType [IN] 枚举传输层, 参数定义参见CameraParams.h定义, 如: #define MV_GIGE_DEVICE 0x00000001 GigE设备
  119. * @param pstDevList [IN][OUT] 设备列表
  120. * @return 成功,返回MV_OK;错误,返回错误码
  121. * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,建议尽量避免多线程枚举操作。
  122. * @remarks 参数枚举传输层,适配传入MV_GIGE_DEVICE、MV_1394_DEVICE、MV_USB_DEVICE、MV_CAMERALINK_DEVICE;MV_GIGE_DEVICE该参数
  123. 传出所有GiGE相关的设备信息(包含虚拟GiGE和GenTL下的GiGE设备),MV_USB_DEVICE该参数传出所有USB设备,包含虚拟USB设备。
  124. * @~english
  125. * @brief Enumerate Device
  126. * @param nTLayerType [IN] Enumerate TLs, Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_GIGE_DEVICE 0x00000001
  127. * @param pstDevList [IN][OUT] Device List
  128. * @return Success, return MV_OK. Failure, return error code
  129. * @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
  130. It is recommended to avoid multithreaded enumeration operations as much as possible.
  131. * @remarks Transmission layer of enumeration, param only include MV_GIGE_DEVICE、MV_1394_DEVICE、MV_USB_DEVICE、MV_CAMERALINK_DEVICE;
  132. MV_GIGE_DEVICE can output virtual and GenTL GiGE devices, MV_USB_DEVICE can output all USB devices, include virtual usb devices.
  133. ************************************************************************/
  134. MV_CAMCTRL_API int __stdcall MV_CC_EnumDevices(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList);
  135. /********************************************************************//**
  136. * @~chinese
  137. * @brief 根据厂商名字枚举设备
  138. * @param nTLayerType [IN] 枚举传输层, 参数定义参见CameraParams.h定义, 如: #define MV_GIGE_DEVICE 0x00000001 GigE设备
  139. * @param pstDevList [IN][OUT] 设备列表
  140. * @param strManufacturerName [IN] 厂商名字
  141. * @return 成功,返回MV_OK;错误,返回错误码
  142. * @remarks 参数枚举传输层,适配传入MV_GIGE_DEVICE、MV_1394_DEVICE、MV_USB_DEVICE、MV_CAMERALINK_DEVICE;MV_GIGE_DEVICE该参数
  143. 传出所有GiGE相关的设备信息(包含虚拟GiGE和GenTL下的GiGE设备),MV_USB_DEVICE该参数传出所有USB设备,包含虚拟USB设备。
  144. * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,建议尽量避免多线程枚举操作。
  145. * @~english
  146. * @brief Enumerate device according to manufacture name
  147. * @param nTLayerType [IN] Transmission layer of enumeration, , Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_GIGE_DEVICE 0x00000001
  148. * @param pstDevList [IN][OUT] Device list
  149. * @param strManufacturerName [IN] Manufacture Name
  150. * @return Success, return MV_OK. Failure, return error code
  151. * @remarks Transmission layer of enumeration, param only include MV_GIGE_DEVICE、MV_1394_DEVICE、MV_USB_DEVICE、MV_CAMERALINK_DEVICE;
  152. MV_GIGE_DEVICE can output virtual and GenTL GiGE devices, MV_USB_DEVICE can output all USB devices, include virtual usb devices.
  153. * @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.
  154. It is recommended to avoid multithreaded enumeration operations as much as possible.
  155. ************************************************************************/
  156. MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesEx(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList, IN const char* strManufacturerName);
  157. /********************************************************************//**
  158. * @~chinese
  159. * @brief 枚举设备扩展(可指定排序方式枚举、根据厂商名字过滤)
  160. * @param nTLayerType [IN] 枚举传输层(区分每一种传输层类型,不耦合), 参数定义参见CameraParams.h定义, 如: #define MV_GIGE_DEVICE 0x00000001 GigE设备
  161. * @param pstDevList [IN][OUT] 设备列表
  162. * @param strManufacturerName [IN] 厂商名字(可传NULL,即不过滤)
  163. * @param enSortMethod [IN] 排序方式
  164. * @return 成功,返回MV_OK;错误,返回错误码
  165. * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,建议尽量避免多线程枚举操作
  166. strManufacturerName可传入NULL,若传入NULL则返回排好序的所有设备列表,若不为NULL则只返回排好序的指定厂商设备列表。
  167. * @~english
  168. * @brief Enumerate device according to the specified ordering
  169. * @param nTLayerType [IN] Transmission layer of enumeration(All layer protocol type can input), Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_GIGE_DEVICE 0x00000001
  170. * @param pstDevList [IN][OUT] Device list
  171. * @param strManufacturerName [IN] Manufacture Name
  172. * @param enSortMethod [IN] Sorting Method
  173. * @return Success, return MV_OK. Failure, return error code
  174. * @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.
  175. It is recommended to avoid multithreaded enumeration operations as much as possible.
  176. strManufacturerName can be passed in NULL,if NULL is passed in, it will return the sorted list of all devices.
  177. If it is not NULL,it will only return the sorted list of the specified manufacturer's devices.
  178. ************************************************************************/
  179. MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesEx2(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList, IN const char* strManufacturerName, IN MV_SORT_METHOD enSortMethod);
  180. /********************************************************************//**
  181. * @~chinese
  182. * @brief 设备是否可连接
  183. * @param pstDevInfo [IN] 设备信息结构体
  184. * @param nAccessMode [IN] 访问权限,参数定义参见CameraParams.h定义, 如:#define MV_ACCESS_Exclusive 1 (该参数:仅对 MV_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE 类型的设备有效)
  185. * @remarks GIGE相机: 读取设备CCP寄存器的值,判断当前状态是否具有某种访问权限
  186. 如果设备(MV_GENTL_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE)不支持MV_ACCESS_ExclusiveWithSwitch、MV_ACCESS_ControlWithSwitch、MV_ACCESS_ControlSwitchEnable这三种模式,接口返回false。(目前设备不支持这3种抢占模式,国际上主流的厂商的设备也都暂不支持这3种模式。)
  187. MV_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE 类型设备:按照nAccessMode,返回当前是否可以被连接;
  188. 该接口支持 虚拟相机,U3V相机,cxp, xof, cameralink采集卡相机, nAccessMode无效,如果相机没有被连接返回true, 如果设备被第三方连接,则返回false
  189. 该接口不支持CameraLink设备(返回false)
  190. * @~english
  191. * @brief Is the device accessible
  192. * @param pstDevInfo [IN] Device Information Structure
  193. * @param nAccessMode [IN] Access Right, Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_ACCESS_Exclusive 1 (This parameter is only valid for devices of type MV_GIGE-DEVICE/MV_GENTL_GIGE-DEVICE)
  194. * @return Access, return true. Not access, return false
  195. * @remarks Read device CCP register value and determine current access permission.
  196. If the device (MV_GENTL_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE) does not support the MV_ACCESS_ExclusiveWithSwitch, MV_ACCESS_ControlWithSwitch, and MV_ACCESS_ControlSwitchEnableWithKey modes, the interface returns false. (At present, the device does not support these three preemptive modes, and the devices of mainstream international manufacturers do not currently support these three modes.)
  197. MV_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE type device: returns whether it can be connected according to nAccessMode;
  198. This interface supports virtual cameras, U3V cameras, cxp, xof, cameralink capture card cameras, nAccessMode is invalid. If the camera is not connected, it returns true. If the device is connected by a third party, it returns false
  199. This interface does not support CameraLink devices (returns false)
  200. **************************************************************************/
  201. MV_CAMCTRL_API bool __stdcall MV_CC_IsDeviceAccessible(IN MV_CC_DEVICE_INFO* pstDevInfo, IN unsigned int nAccessMode);
  202. /********************************************************************//**
  203. * @~chinese
  204. * @brief 创建设备句柄
  205. * @param handle [IN][OUT] 设备句柄
  206. * @param pstDevInfo [IN] 设备信息结构体
  207. * @return 成功,返回MV_OK;错误,返回错误码
  208. * @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块
  209. 通过该接口创建句柄,调用SDK接口,会默认生成SDK日志文件,如果不需要生成日志文件,可以将日志配置文件中的日志等级改成off
  210. * @~english
  211. * @brief Create Device Handle
  212. * @param handle [IN][OUT] Device handle
  213. * @param pstDevInfo [IN] Device Information Structure
  214. * @return Success, return MV_OK. Failure, return error code
  215. * @remarks Create required resources within library and initialize internal module according to input device information.
  216. By creating a handle through this interface and calling the SDK interface, SDK log files will be generated by default. If no log file needs to be generated, the log level in the log configuration file can be changed to off
  217. ************************************************************************/
  218. MV_CAMCTRL_API int __stdcall MV_CC_CreateHandle(IN OUT void ** handle, IN const MV_CC_DEVICE_INFO* pstDevInfo);
  219. /********************************************************************//**
  220. * @~chinese
  221. * @brief 销毁设备句柄
  222. * @param handle [IN] 设备句柄
  223. * @return 成功,返回MV_OK;错误,返回错误码
  224. * @remarks MV_CC_DestroyHandle 如果传入采集卡句柄,其效果和 MV_CC_DestroyInterface 相同;
  225. * @~english
  226. * @brief Destroy Device Handle
  227. * @param handle [IN] Device handle
  228. * @return Success, return MV_OK. Failure, return error code
  229. * @remarks If MV_CC_DestroyHandle passes in "Frame grabber handle", the effect is the same as the MV_CC_DestroyInterface
  230. ************************************************************************/
  231. MV_CAMCTRL_API int __stdcall MV_CC_DestroyHandle(IN void * handle);
  232. /********************************************************************//**
  233. * @~chinese
  234. * @brief 打开设备
  235. * @param handle [IN] 设备句柄
  236. * @param nAccessMode [IN] 访问权限, 参数定义参见CameraParams.h定义, 如:#define MV_ACCESS_Exclusive 1 (仅对 MV_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE 类型的设备有效)
  237. * @param nSwitchoverKey [IN] 切换访问权限时的密钥 (仅对 MV_GIGE_DEVICE 类型的设备有效)
  238. * @return 成功,返回MV_OK;错误,返回错误码
  239. * @remarks 根据设置的设备参数,找到对应的设备,连接设备, 调用接口时可不传入nAccessMode和nSwitchoverKey,此时默认设备访问模式为独占权限。
  240. MV_GIGE_DEVICE 类型设备,目前相机固件暂不支持MV_ACCESS_ExclusiveWithSwitch、MV_ACCESS_ControlWithSwitch、MV_ACCESS_ControlSwitchEnable、MV_ACCESS_ControlSwitchEnableWithKey这四种抢占模式, SDK接口支持设置
  241. MV_GENTL_GIGE_DEVICE 设备只支持 nAccessMode 是 MV_ACCESS_Exclusive 、MV_ACCESS_Control 、MV_ACCESS_Monitor权限
  242. 对于U3V设备,CXP,Cameralink(MV_CAMERALINK_DEVICE、MV_GENTL_CAMERALINK_DEVICE), Xof设备, 虚拟GEV, 虚拟U3V设备:nAccessMode、nSwitchoverKey这两个参数无效; 默认以控制权限打开设备;
  243. 该接口支持网口设备不枚举直接打开,不支持U口和GenTL设备不枚举打开设备
  244. * @~english
  245. * @brief Open Device
  246. * @param handle [IN] Device handle
  247. * @param nAccessMode [IN] Access Right, Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_ACCESS_Exclusive 1 (Effective only for the device type of MV_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE)
  248. * @param nSwitchoverKey [IN] Switch key of access right (Effective only for the device type of MV_GIGE_DEVICE)
  249. * @return Success, return MV_OK. Failure, return error code
  250. * @remarks Find specific device and connect according to set device parameters.When calling the interface, the input of nAccessMode and nSwitchoverKey is optional,
  251. and the device access mode is exclusive. The device type of MV_GIGE_DEVICE, Currently the device firmware does not support the following preemption modes:
  252. MV_ACCESS_ExclusiveWithSwitch, MV_ACCESS_ControlWithSwitch, MV_ACCESS_ControlSwitchEnable, MV_ACCESS_ControlSwitchEnableWithKey; SDK Interface will return MV_OK.
  253. The device type of MV_GENTL_GIGE_DEVICE, only support nAccessMode as MV_ACCESS_Exclusive, MV_ACCESS_Control, MV_ACCESS_Monitor;
  254. For USB3Vision device, CXP device, Cameralink device(MV_CAMERALINK_DEVICE、MV_GENTL_CAMERALINK_DEVICE), Xof device, virtual GEV devoce, virtual U3V device,
  255. nAccessMode, nSwitchoverKey are invalid. Open device with MV_ACCESS_Control in default.
  256. This Interface support open without enumeration by GEV device,USB device and GenTL device don't support .
  257. ************************************************************************/
  258. #ifndef __cplusplus
  259. MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, IN unsigned int nAccessMode, IN unsigned short nSwitchoverKey);
  260. #else
  261. MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, IN unsigned int nAccessMode = MV_ACCESS_Exclusive, IN unsigned short nSwitchoverKey = 0);
  262. #endif
  263. /********************************************************************//**
  264. * @~chinese
  265. * @brief 关闭设备
  266. * @param handle [IN] 设备句柄
  267. * @return 成功,返回MV_OK;错误,返回错误码
  268. * @remarks 通过MV_CC_OpenDevice连接设备后,可以通过该接口断开设备连接,释放资源
  269. * @~english
  270. * @brief Close Device
  271. * @param handle [IN] Device handle
  272. * @return Success, return MV_OK. Failure, return error code
  273. * @remarks After connecting to device through MV_CC_OpenDevice, use this interface to disconnect and release resources.
  274. ***********************************************************************/
  275. MV_CAMCTRL_API int __stdcall MV_CC_CloseDevice(IN void* handle);
  276. /********************************************************************//**
  277. * @~chinese
  278. * @brief 判断设备是否处于连接状态
  279. * @param handle [IN] 设备句柄
  280. * @return 设备处于连接状态,返回true;没连接或失去连接,返回false
  281. * @~english
  282. * @brief Is The Device Connected
  283. * @param handle [IN] Device handle
  284. * @return Connected, return true. Not Connected or DIsconnected, return false
  285. ***********************************************************************/
  286. MV_CAMCTRL_API bool __stdcall MV_CC_IsDeviceConnected(IN void* handle);
  287. /********************************************************************//**
  288. * @~chinese
  289. * @brief 注册图像数据回调
  290. * @param handle [IN] 设备句柄
  291. * @param cbOutput [IN] 回调函数指针
  292. * @param pUser [IN] 用户自定义变量
  293. * @return 成功,返回MV_OK;错误,返回错误码
  294. * @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用, 图像数据采集有两种方式,两种方式不能复用:
  295. 方式一:调用MV_CC_RegisterImageCallBackEx设置图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回
  296. 方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetOneFrameTimeout获取指定像素格式的帧数据,
  297. 获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。
  298. 该接口不支持MV_CAMERALINK_DEVICE 类型的设备。
  299. * @~english
  300. * @brief Register the image callback function
  301. * @param handle [IN] Device handle
  302. * @param cbOutput [IN] Callback function pointer
  303. * @param pUser [IN] User defined variable
  304. * @return Success, return MV_OK. Failure, return error code
  305. * @remarks After MV_CC_CreateHandle, call this interface to set image data callback function.There are two available image data acquisition modes, and cannot be used together:
  306. 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.
  307. 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,
  308. the frequency of calling this interface should be controlled by upper layer application according to frame rate.
  309. This interface does not support devices of type MV_CAMERALINK_DEVICE
  310. ***********************************************************************/
  311. MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackEx(IN void* handle,
  312. IN void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser), IN void* pUser);
  313. /********************************************************************//**
  314. * @~chinese
  315. * @brief 开始取流
  316. * @param handle [IN] 设备句柄
  317. * @return 成功,返回MV_OK;错误,返回错误码
  318. * @remarks 该接口不支持MV_CAMERALINK_DEVICE 类型的设备。
  319. * @~english
  320. * @brief Start Grabbing
  321. * @param handle [IN] Device handle
  322. * @return Success, return MV_OK. Failure, return error code
  323. * @remarks This interface does not support devices of type MV_CAMERALINK_DEVICE
  324. ***********************************************************************/
  325. MV_CAMCTRL_API int __stdcall MV_CC_StartGrabbing(IN void* handle);
  326. /********************************************************************//**
  327. * @~chinese
  328. * @brief 停止取流
  329. * @param handle [IN] 设备句柄
  330. * @return 成功,返回MV_OK;错误,返回错误码
  331. * @remarks 该接口不支持MV_CAMERALINK_DEVICE 类型的设备。
  332. * @~english
  333. * @brief Stop Grabbing
  334. * @param handle [IN] Device handle
  335. * @return Success, return MV_OK. Failure, return error code
  336. * @remarks This interface does not support devices of type MV_CAMERALINK_DEVICE
  337. ***********************************************************************/
  338. MV_CAMCTRL_API int __stdcall MV_CC_StopGrabbing(IN void* handle);
  339. /********************************************************************//**
  340. * @~chinese
  341. * @brief 使用内部缓存获取一帧图片(与MV_CC_Display不能同时使用)
  342. * @param handle [IN] 设备句柄
  343. * @param pstFrame [IN][OUT] 图像数据和图像信息
  344. * @param nMsec [IN] 等待超时时间,输入INFINITE时表示无限等待,直到收到一帧数据或者停止取流
  345. * @return 成功,返回MV_OK;错误,返回错误码
  346. * @remarks 调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率,
  347. 该接口支持设置超时时间,SDK内部等待直到有数据时返回,可以增加取流平稳性,适合用于对平稳性要求较高的场合。
  348. 该接口与MV_CC_FreeImageBuffer配套使用,当处理完取到的数据后,需要用MV_CC_FreeImageBuffer接口将pFrame内的数据指针权限进行释放。
  349. 该接口与MV_CC_GetOneFrameTimeout相比,有着更高的效率。且其取流缓存的分配是由sdk内部自动分配的,而MV_CC_GetOneFrameTimeout接口是需要客户自行分配。
  350. 该接口在调用MV_CC_Display后无法取流。
  351. 该接口对于U3V、GIGE设备均可支持。
  352. 该接口不支持CameraLink设备。
  353. * @~english
  354. * @brief Get a frame of an image using an internal cache
  355. * @param handle [IN] Device handle
  356. * @param pstFrame [IN][OUT] Image data and image information
  357. * @param nMsec [IN] Waiting timeout
  358. * @return Success, return MV_OK. Failure, return error code
  359. * @remarks Before calling this API to get image data frame, you should call MV_CC_StartGrabbing to start image acquisition.
  360. 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.
  361. 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.
  362. 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.
  363. This API cannot be called to stream after calling MV_CC_Display.
  364. This API is not supported by CameraLink device.
  365. This API is supported by both USB3 vision camera and GigE camera.
  366. *****************************************************************************/
  367. MV_CAMCTRL_API int __stdcall MV_CC_GetImageBuffer(IN void* handle, IN OUT MV_FRAME_OUT* pstFrame, IN unsigned int nMsec);
  368. /********************************************************************//**
  369. * @~chinese
  370. * @brief 释放图像缓存(此接口用于释放不再使用的图像缓存,与MV_CC_GetImageBuffer配套使用)
  371. * @param handle [IN] 设备句柄
  372. * @param pstFrame [IN] 图像数据和图像数据
  373. * @return 成功,返回MV_OK;错误,返回错误码
  374. * @remarks 该接口与MV_CC_GetImageBuffer配套使用,使用MV_CC_GetImageBuffer接口取到的图像数据pFrame,需要用MV_CC_FreeImageBuffer接口进行权限释放
  375. 该接口取流效率高于GetOneFrameTimeout接口
  376. 当GetImageBuffer不进行FreeImageBuffer时,最大输出图像个数为当前配置下SDK的缓存节点个数(用户可以调用SetImageNode接口,调节SDK的缓存个数)
  377. 该接口对于U3V、GIGE设备均可支持
  378. 该接口不支持CameraLink设备。
  379. * @~english
  380. * @brief Free image buffer(this interface can free image buffer, used with MV_CC_GetImageBuffer)
  381. * @param handle [IN] Device handle
  382. * @param pstFrame [IN] Image data and image information
  383. * @return Success, return MV_OK. Failure, return error code
  384. * @remarks MV_CC_FreeImageBuffer and MV_CC_GetImageBuffer API call in pairs, before calling MV_CC_GetImageBuffer to get image data pFrame, you should call MV_CC_FreeImageBuffer to release the permission.
  385. Compared with API MV_CC_GetOneFrameTimeout
  386. The API has higher efficiency of image acquisition. The max. number of nodes can be outputted is same as the "nNum" of the current configuration of the SDK's cache (users can call the SetImageNode interface to adjust the SDK's cache count)
  387. The API is not supported by CameraLink device.
  388. The API is supported by both USB3 vision camera and GigE camera.
  389. **********************************************************************/
  390. MV_CAMCTRL_API int __stdcall MV_CC_FreeImageBuffer(IN void* handle, IN MV_FRAME_OUT* pstFrame);
  391. /********************************************************************//**
  392. * @~chinese
  393. * @brief 采用超时机制获取一帧图片,SDK内部等待直到有数据时返回
  394. * @param handle [IN] 设备句柄
  395. * @param pData [IN][OUT] 图像数据接收指针
  396. * @param nDataSize [IN] 接收缓存大小
  397. * @param pstFrameInfo [IN][OUT] 图像信息结构体
  398. * @param nMsec [IN] 等待超时时间
  399. * @return 成功,返回MV_OK;错误,返回错误码
  400. * @remarks 调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集
  401. 该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率
  402. 该接口支持设置超时时间,SDK内部等待直到有数据时返回,可以增加取流平稳性,适合用于对平稳性要求较高的场合
  403. 该接口对于U3V、GIGE设备均可支持
  404. 该接口不支持CameraLink设备。
  405. * @~english
  406. * @brief Timeout mechanism is used to get image, and the SDK waits inside until the data is returned
  407. * @param handle [IN] Device handle
  408. * @param pData [IN][OUT] Image data receiving buffer
  409. * @param nDataSize [IN] Buffer size
  410. * @param pstFrameInfo [IN][OUT] Image information structure
  411. * @param nMsec [IN] Waiting timeout
  412. * @return Success, return MV_OK. Failure, return error code
  413. * @remarks Before calling this API to get image data frame, call MV_CC_StartGrabbing to start image acquisition.
  414. This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate.
  415. 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.
  416. Both the USB3Vision and GIGE camera can support this API.
  417. This API is not supported by CameraLink device.
  418. ***********************************************************************/
  419. 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, IN unsigned int nMsec);
  420. /********************************************************************//**
  421. * @~chinese
  422. * @brief 清除取流数据缓存
  423. * @param handle [IN] 设备句柄
  424. * @return 成功,返回MV_OK;错误,返回错误码
  425. * @remarks 该接口允许用户在不停止取流的时候,就能清除缓存中不需要的图像
  426. 该接口在连续模式切触发模式后,可以清除历史数据。
  427. 该接口目前只能清除SDK内部的图像缓存,采集卡内的缓存还无法清除。
  428. * @~english
  429. * @brief if Image buffers has retrieved the data,Clear them
  430. * @param handle [IN] Device handle
  431. * @return Success, return MV_OK. Failure, return error code
  432. * @remarks This interface allows user to clear the unnecessary images from the buffer memory without stopping acquisition.
  433. This interface allows user to clear previous data after switching from continuous mode to trigger mode.
  434. This interface can only clear the image cache inside the SDK, and the cache in the Frame grabber cannot be cleared.
  435. ***********************************************************************/
  436. MV_CAMCTRL_API int __stdcall MV_CC_ClearImageBuffer(IN void* handle);
  437. /********************************************************************//**
  438. * @~chinese
  439. * @brief 获取当前图像缓存区的有效图像个数
  440. * @param handle [IN] 设备句柄
  441. * @param pnValidImageNum [IN][OUT] 当前图像缓存区中有效图像个数的指针
  442. * @return 成功,返回MV_OK;错误,返回错误码
  443. * @remarks 该接口只统计SDK内部的有效图像个数,不包括采集卡缓存内的有效图像个数
  444. * @~english
  445. * @brief Get the number of valid images in the current image buffer
  446. * @param handle [IN] Device handle
  447. * @param pnValidImageNum [IN][OUT] The number of valid images in the current image buffer
  448. * @return Success, return MV_OK. Failure, return error code
  449. * @remarks This interface only counts the number of valid images inside the SDK, not including the number of valid images in the capture card cache.
  450. ***********************************************************************/
  451. MV_CAMCTRL_API int __stdcall MV_CC_GetValidImageNum(IN void* handle, IN OUT unsigned int *pnValidImageNum);
  452. /********************************************************************//**
  453. * @~chinese
  454. * @brief 显示一帧图像
  455. * @param handle [IN] 设备句柄
  456. * @param hWnd [IN] 窗口句柄
  457. * @param pstDisplayInfo [IN] 图像信息
  458. * @return 成功,返回MV_OK;错误,返回错误码
  459. * @remarks 该接口支持渲染宽高大小至int类型
  460. * 渲染模式为D3D时,支持的最大分辨率为16384 * 163840
  461. * @~english
  462. * @brief Display one frame image
  463. * @param handle [IN] Device handle
  464. * @param hWnd [IN] HWND
  465. * @param pstDisplayInfo [IN] Frame Info
  466. * @return Success, return MV_OK. Failure, return error code
  467. * @remarks The rendering supports width and height to int type.
  468. * When the render mode is D3D, the maximum resolution supported is 16384 * 163840.
  469. ***********************************************************************/
  470. MV_CAMCTRL_API int __stdcall MV_CC_DisplayOneFrameEx(IN void* handle, IN void* hWnd, IN MV_DISPLAY_FRAME_INFO_EX* pstDisplayInfo);
  471. /********************************************************************//**
  472. * @~chinese
  473. * @brief 显示一帧图像
  474. * @param handle [IN] 设备句柄
  475. * @param hWnd [IN] 窗口句柄
  476. * @param pstImage [IN] 图像信息
  477. * @param enRenderMode [IN] 渲染方式,Windows:0-GDI 1-D3D 2-OpenGL Linux:0-OpenGL
  478. * @return 成功,返回MV_OK;错误,返回错误码
  479. * @remarks 可选择OpenGL渲染模式,支持PixelType_Gvsp_RGB8_Packed,PixelType_Gvsp_BGR8_Packed,PixelType_Gvsp_Mono8三种像素格式图像大小超过4GB的渲染,其他渲染模式不支持。
  480. 若图像大小未超过4GB,支持宽高大小至int类型
  481. 调用时需要输入MV_CC_IMAGE结构体中nImageLen的值
  482. 渲染模式为D3D时,支持的最大分辨率为16384 * 163840
  483. * @~english
  484. * @brief Display one frame image
  485. * @param handle [IN] Device handle
  486. * @param hWnd [IN] HWND
  487. * @param pstImage [IN] Frame Info
  488. * @param enRenderMode [IN] Render mode, Windows:0-GDI 1-D3D 2-OpenGL Linux:0-OpenGL
  489. * @return Success, return MV_OK. Failure, return error code
  490. * @remarks OpenGL rendering mode can be selected, supporting three pixel formats: PixelType_Gvsp_RGB8_Packed,PixelType_Gvsp_BGR8_Packed,and PixelType_Gvsp_Mono8 for rendering images with a size exceeding 4GB.
  491. Note that, other rendering modes are not supported.
  492. If the image size does not exceed 4GB, the rendering supports width and height to int type.
  493. When the render mode is D3D, the maximum resolution supported is 16384 * 163840.
  494. When calling, the value of nImageLen in the MV_CC_IMAGE structure needs to be input.
  495. ***********************************************************************/
  496. MV_CAMCTRL_API int __stdcall MV_CC_DisplayOneFrameEx2(IN void* handle, IN void* hWnd, IN MV_CC_IMAGE* pstImage, unsigned int enRenderMode);
  497. /********************************************************************//**
  498. * @~chinese
  499. * @brief 设置SDK内部图像缓存节点个数,大于等于1,在抓图前调用
  500. * @param handle [IN] 设备句柄
  501. * @param nNum [IN] 缓存节点个数
  502. * @return 成功,返回MV_OK;错误,返回错误码
  503. * @remarks 调用该接口可以设置SDK内部图像缓存节点个数,在调用MV_CC_StartGrabbing开始抓图前调用。
  504. 不同相机因为取流方式不同,不调用MV_CC_SetImageNodeNum接口情况下,默认不同相机默认缓存节点个数不同:比如 双U内部分配默认3个节点
  505. SDK实际分配的节点个数 = SDK内部预分配的个数 + 用户分配的节点(MV_CC_SetImageNodeNum);若系统内存资源不够,SDK内部会重新计算, 以重新计算的节点个数为准
  506. 该接口不支持MV_CAMERALINK_DEVICE 类型的设备。
  507. 该接口仅对SDK内部分配缓存模式有效,外部分配缓存模式(即调用MV_CC_RegisterBuffer)无效;
  508. * @~english
  509. * @brief Set the number of the internal image cache nodes in SDK, Greater than or equal to 1, to be called before the capture
  510. * @param handle [IN] Device handle
  511. * @param nNum [IN] Image Node Number
  512. * @return Success, return MV_OK. Failure, return error code
  513. * @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.
  514. Due to different stream retrieval methods, different cameras default to different cache nodes by default when not calling the MV_CC_SetImageNodeNum interface. For example, for dual U internal allocation, the default number of cache nodes is 3
  515. The actual number of nodes allocated by the SDK = the number of pre allocated nodes within the SDK + the number of nodes allocated by the user (MV_CC_SetImageNodeNum)
  516. If the system memory resources are insufficient, the SDK will recalculate and use it as the actual number of nodes.
  517. This interface does not support devices of type MV_CAMERALINK_DEVICE
  518. This interface is only valid for the SDK's internal allocation cache mode, and the external allocation cache mode (i.e., calling MV_CC_RegisterBuffer) is invalid;
  519. ***********************************************************************/
  520. MV_CAMCTRL_API int __stdcall MV_CC_SetImageNodeNum(IN void* handle, IN unsigned int nNum);
  521. /********************************************************************//**
  522. * @~chinese
  523. * @brief 设置取流策略
  524. * @param handle [IN] 设备句柄
  525. * @param enGrabStrategy [IN] 策略枚举值
  526. * @return 成功,返回MV_OK;错误,返回错误码
  527. * @remarks 该接口定义了四种取流策略,用户可以根据实际需求进行选择。具体描述如下:
  528. OneByOne: 从旧到新一帧一帧的从输出缓存列表中获取图像,打开设备后默认为该策略
  529. LatestImagesOnly: 仅从输出缓存列表中获取最新的一帧图像,同时清空输出缓存列表
  530. LatestImages: 从输出缓存列表中获取最新的OutputQueueSize帧图像,其中OutputQueueSize范围为1-ImageNodeNum,可用MV_CC_SetOutputQueueSize接口设置,ImageNodeNum默认为1,
  531. 可用MV_CC_SetImageNodeNum接口设置 OutputQueueSize设置成1等同于LatestImagesOnly策略,OutputQueueSize设置成ImageNodeNum等同于OneByOne策略
  532. UpcomingImage: 在调用取流接口时忽略输出缓存列表中所有图像,并等待设备即将生成的一帧图像。(该策略不支持MV_USB_DEVICE设备)
  533. 该接口在Windows平台仅支持MV_GIGE_DEVICE、MV_USB_DEVICE设备,在Linux平台仅支持MV_USB_DEVICE设备;
  534. * @~english
  535. * @brief Set Grab Strategy
  536. * @param handle [IN] Device handle
  537. * @param enGrabStrategy [IN] The value of Grab Strategy
  538. * @return Success, return MV_OK. Failure, return error code
  539. * @remarks This interface is set by four image acquisition approaches, the user may choose one as needed. Specific details are as followed:
  540. OneByOne:Obtain image from output cache list frame by frame in order, this function is default strategy when device is on.
  541. LatestImagesOnly:Obtain the latest image from output cache list only, meanwhile clear output cache list.
  542. LatestImages:Obtain the latest OutputQueueSize image from output cache list, the range of OutputQueueSize is 1-ImageNodeNum,
  543. the user may set the value of MV_CC_SetOutputQueueSizeinterface,the default value of ImageNodeNum is 1,
  544. If the user usesMV_CC_SetImageNodeNuminterface to set up OutputQueueSize,when the value of OutputQueueSize is set to be 1,
  545. the function will be same as LatestImagesOnly; if the value of OutputQueueSize is set to be ImageNodeNum, the function will be same as OneByOne.
  546. UpcomingImage:Ignore all images in output cache list when calling image acuiqisiotn interface, wait the next upcoming image generated.(This strategy does not support MV_USB_DEVICE device)
  547. This API only support MV_GIGE_DEVICE, MV_USB_DEVICE device on Windows, and only support MV_USB_DEVICE device on Linux.
  548. ***********************************************************************/
  549. MV_CAMCTRL_API int __stdcall MV_CC_SetGrabStrategy(IN void* handle, IN MV_GRAB_STRATEGY enGrabStrategy);
  550. /********************************************************************//**
  551. * @~chinese
  552. * @brief 设置输出缓存个数(只有在MV_GrabStrategy_LatestImages策略下才有效,范围:1-ImageNodeNum)
  553. * @param handle [IN] 设备句柄
  554. * @param nOutputQueueSize [IN] 输出缓存个数
  555. * @return 成功,返回MV_OK;错误,返回错误码
  556. * @remarks 该接口需与LatestImages取流策略配套调用,用于设置LatestImages策略下最多允许缓存图像的个数。可以在取流过程中动态调节输出缓存个数
  557. * 若为双U口相机,nOutputQueueSize最小应设置为2
  558. 该接口在Windows平台仅支持MV_GIGE_DEVICE、MV_USB_DEVICE设备,在Linux平台仅支持MV_USB_DEVICE设备;
  559. * @~english
  560. * @brief Set The Size of Output Queue(Only work under the strategy of MV_GrabStrategy_LatestImages,rang:1-ImageNodeNum)
  561. * @param handle [IN] Device handle
  562. * @param nOutputQueueSize [IN] The Size of Output Queue
  563. * @return Success, return MV_OK. Failure, return error code
  564. * @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.
  565. The user may change the output queue size while grabbing images.
  566. * The DoubleUsb Device nOutputQueueSize at least 2
  567. This API only support MV_GIGE_DEVICE, MV_USB_DEVICE device on Windows, and only support MV_USB_DEVICE device on Linux.
  568. ***********************************************************************/
  569. MV_CAMCTRL_API int __stdcall MV_CC_SetOutputQueueSize(IN void* handle, IN unsigned int nOutputQueueSize);
  570. /********************************************************************//**
  571. * @~chinese
  572. * @brief 获取设备信息,取流之前调用
  573. * @param handle [IN] 设备句柄
  574. * @param pstDevInfo [IN][OUT] 返回给调用者有关设备信息结构体指针
  575. * @return 成功,返回MV_OK,失败,返回错误码
  576. * @remarks 支持用户在打开设备后获取设备信息,不支持GenTL设备
  577. 若该设备是GigE设备,则调用该接口存在阻塞风险,因此不建议在取流过程中调用该接口。
  578. * @~english
  579. * @brief Get device information
  580. * @param handle [IN] Device handle
  581. * @param pstDevInfo [IN][OUT] Structure pointer of device information
  582. * @return Success, return MV_OK. Failure, return error code
  583. * @remarks The API support users to access device information after opening the device,don't support GenTL Devices
  584. 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.
  585. ************************************************************************/
  586. MV_CAMCTRL_API int __stdcall MV_CC_GetDeviceInfo(IN void * handle, IN OUT MV_CC_DEVICE_INFO* pstDevInfo);
  587. /********************************************************************//**
  588. * @~chinese
  589. * @brief 获取各种类型的信息
  590. * @param handle [IN] 设备句柄
  591. * @param pstInfo [IN][OUT] 返回给调用者有关设备各种类型的信息结构体指针
  592. * @return 成功,返回MV_OK,失败,返回错误码
  593. * @remarks 接口里面输入需要获取的信息类型(指定MV_ALL_MATCH_INFO结构体中的nType类型),获取对应的信息(在MV_ALL_MATCH_INFO结构体中pInfo里返回)
  594. 该接口的调用前置条件取决于所获取的信息类型,获取GigE设备的MV_MATCH_TYPE_NET_DETECT信息需在开启抓图之后调用,获取U3V设备的MV_MATCH_TYPE_USB_DETECT信息需在打开设备之后调用
  595. 信息类型 MV_MATCH_TYPE_NET_DETECT 对应结构体MV_MATCH_INFO_NET_DETECT, 只支持MV_GIGE_DEVICE相机/MV_GENTL_GIGE_DEVICE相机
  596. 信息类型 MV_MATCH_TYPE_USB_DETECT 对应结构体MV_MATCH_INFO_USB_DETECT, 只支持MV_USB_DEVICE 类型相机
  597. 该接口不支持MV_CAMERALINK_DEVICE设备。
  598. * @~english
  599. * @brief Get various type of information
  600. * @param handle [IN] Device handle
  601. * @param pstInfo [IN][OUT] Structure pointer of various type of information
  602. * @return Success, return MV_OK. Failure, return error code
  603. * @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)
  604. 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,
  605. and call after starting device to get MV_MATCH_TYPE_USB_DETECT information of USB3Vision device.
  606. The information type MV_MATCH_TYPE_NET_DETECT corresponds to the structure MV_MATCH_INFO_NET_DETECT, which only supports cameras of MV_GIGE_DEVICE and MV_GENTL_GIGE_DEVICE types
  607. The information type MV_MATCH_TYPE_USB_DETECT corresponds to the structure MV_MATCH_INFO_USB_DETECT, which only supports cameras of MV_USB_DEVICE type
  608. This API is not supported by MV_CAMERALINK_DEVICE device.
  609. ************************************************************************/
  610. MV_CAMCTRL_API int __stdcall MV_CC_GetAllMatchInfo(IN void* handle, IN OUT MV_ALL_MATCH_INFO* pstInfo);
  611. /**************************Part3 ch: 采集卡的配置 | en: Frame grabber control ******************************************/
  612. /********************************************************************//**
  613. * @~chinese
  614. * @brief 枚举采集卡
  615. * @param nTLayerType [IN] 采集卡接口类型 eg: (MV_GIGE_INTERFACE | MV_CAMERALINK_INTERFACE | MV_CXP_INTERFACE| MV_XOF_INTERFACE | MV_VIR_INTERFACE)
  616. * @param pInterfaceInfoList [IN][OUT] 采集卡列表
  617. * @return 成功,返回MV_OK;错误,返回错误码
  618. * @remarks 该接口不支持arm和Linux32平台
  619. * @~english
  620. * @brief enum Frame grabber
  621. * @param nTLayerType [IN] Frame grabber Type eg: (MV_GIGE_INTERFACE | MV_CAMERALINK_INTERFACE | MV_CXP_INTERFACE| MV_XOF_INTERFACE | MV_VIR_INTERFACE)
  622. * @param pInterfaceInfoList [IN][OUT] Frame grabbe List
  623. * @return Success, return MV_OK. Failure, return error code
  624. * @remarks This API do not support arm and Linux32 platform.
  625. ************************************************************************/
  626. MV_CAMCTRL_API int __stdcall MV_CC_EnumInterfaces(IN unsigned int nTLayerType, IN OUT MV_INTERFACE_INFO_LIST* pInterfaceInfoList);
  627. /********************************************************************//**
  628. * @~chinese
  629. * @brief 创建采集卡句柄
  630. * @param handle [OUT] 采集卡句柄
  631. * @param pInterfaceInfo [IN] 采集卡信息
  632. * @return 成功,返回MV_OK;错误,返回错误码
  633. * @remarks 该接口不支持arm和Linux32平台
  634. * @~english
  635. * @brief create Frame grabber handle
  636. * @param handle [OUT] Frame grabber handle
  637. * @param pInterfaceInfo [IN] Frame grabber Info
  638. * @return Success, return MV_OK. Failure, return error code
  639. * @remarks This API do not support arm and Linux32 platform.
  640. ************************************************************************/
  641. MV_CAMCTRL_API int __stdcall MV_CC_CreateInterface(IN OUT void ** handle, IN MV_INTERFACE_INFO* pInterfaceInfo);
  642. /********************************************************************//**
  643. * @~chinese
  644. * @brief 通过采集卡ID创建采集卡句柄
  645. * @param handle [IN][OUT] 采集卡句柄
  646. * @param pInterfaceID [IN] 采集卡ID
  647. * @return 成功,返回MV_OK;错误,返回错误码
  648. * @remarks 该接口不支持arm和Linux32平台
  649. * @~english
  650. * @brief create Frame grabber handle by ID
  651. * @param handle [IN][OUT] Frame grabber handle
  652. * @param pInterfaceID [IN] Frame grabber ID
  653. * @return Success, return MV_OK. Failure, return error code
  654. * @remarks This API do not support arm and Linux32 platform.
  655. ************************************************************************/
  656. MV_CAMCTRL_API int __stdcall MV_CC_CreateInterfaceByID(IN OUT void ** handle, IN const char* pInterfaceID);
  657. /********************************************************************//**
  658. * @~chinese
  659. * @brief 打开采集卡
  660. * @param handle [IN] 采集卡句柄
  661. * @param pReserved [IN] 预留,直接填NULL
  662. * @return 成功,返回MV_OK;错误,返回错误码
  663. * @remarks 该接口不支持arm和Linux32平台
  664. * @~english
  665. * @brief open Frame grabber
  666. * @param handle [IN] Frame grabber handle
  667. * @param pReserved [IN] Reserved,default NULL
  668. * @return Success, return MV_OK. Failure, return error code
  669. * @remarks This API do not support arm and Linux32 platform.
  670. ************************************************************************/
  671. MV_CAMCTRL_API int __stdcall MV_CC_OpenInterface(IN void* handle, IN char* pReserved);
  672. /********************************************************************//**
  673. * @~chinese
  674. * @brief 关闭采集卡
  675. * @param handle [IN] 采集卡句柄
  676. * @return 成功,返回MV_OK;错误,返回错误码
  677. * @remarks 该接口不支持arm和Linux32平台
  678. * @~english
  679. * @brief close Frame grabber
  680. * @param handle [IN] Frame grabber handle
  681. * @return Success, return MV_OK. Failure, return error code
  682. * @remarks This API do not support arm and Linux32 platform.
  683. ************************************************************************/
  684. MV_CAMCTRL_API int __stdcall MV_CC_CloseInterface(IN void* handle);
  685. /********************************************************************//**
  686. * @~chinese
  687. * @brief 销毁采集卡句柄
  688. * @param handle [IN]采集卡句柄
  689. * @return 成功,返回MV_OK;错误,返回错误码
  690. * @remarks MV_CC_DestroyInterface 如果传入相机句柄,其效果和 MV_CC_DestroyHandle 相同; 该接口不支持arm和Linux32平台
  691. * @~english
  692. * @brief Destroy Frame grabber handle
  693. * @param handle [IN] Frame grabber handle
  694. * @return Success, return MV_OK. Failure, return error code
  695. * @remarks If MV_CC_DestroyInterface passes in "Device handle", the effect is the same as the MV_CC_DestroyHandle. This API do not support arm and Linux32 platform.
  696. ************************************************************************/
  697. MV_CAMCTRL_API int __stdcall MV_CC_DestroyInterface(IN void* handle);
  698. /********************************************************************//**
  699. * @~chinese
  700. * @brief 通过采集卡句柄枚举设备
  701. * @param handle [IN] 采集卡句柄
  702. * @param pstDevList [OUT] 设备列表
  703. * @return 成功,返回MV_OK;错误,返回错误码
  704. * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请
  705. 建议尽量避免多线程枚举操作。
  706. * @~english
  707. * @brief Enumerate Devices with interface handle
  708. * @param handle [IN] Interface information
  709. * @param pstDevList [OUT] Device List
  710. * @return Success, return MV_OK. Failure, return error code
  711. * @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
  712. It is recommended to avoid multithreaded enumeration operations as much as possible.
  713. ************************************************************************/
  714. MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesByInterface(IN void* handle, OUT MV_CC_DEVICE_INFO_LIST* pstDevList);
  715. /*******************Part4 ch: 相机/采集卡属性万能配置接口 | en: Camera /Frame grabber attribute nodes universal interface*******************/
  716. /********************************************************************//**
  717. * @~chinese
  718. * @brief 获取Integer属性值
  719. * @param handle [IN] 设备句柄/采集卡句柄
  720. * @param strKey [IN] 属性键值,如获取宽度信息则为"Width"
  721. * @param pstIntValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  722. * @return 成功,返回MV_OK,失败,返回错误码
  723. * @remarks 连接设备之后调用该接口可以获取int类型的指定节点的值。
  724. * @~english
  725. * @brief Get Integer value
  726. * @param handle [IN] Device handle/Frame grabber handle
  727. * @param strKey [IN] Key value, for example, using "Width" to get width
  728. * @param pstIntValue [IN][OUT] Structure pointer of camera features
  729. * @return Success, return MV_OK. Failure, return error code
  730. * @remarks You can call this API to get the value of camera node with integer type after connecting the device.
  731. ************************************************************************/
  732. MV_CAMCTRL_API int __stdcall MV_CC_GetIntValueEx(IN void* handle,IN const char* strKey,IN OUT MVCC_INTVALUE_EX *pstIntValue);
  733. /********************************************************************//**
  734. * @~chinese
  735. * @brief 设置Integer型属性值
  736. * @param handle [IN] 设备句柄/采集卡句柄
  737. * @param strKey [IN] 属性键值,如获取宽度信息则为"Width"
  738. * @param nValue [IN] 想要设置的设备的属性值
  739. * @return 成功,返回MV_OK,失败,返回错误码
  740. * @remarks 连接设备之后调用该接口可以设置int类型的指定节点的值。
  741. * @~english
  742. * @brief Set Integer value
  743. * @param handle [IN] Device handle/Frame grabber handle
  744. * @param strKey [IN] Key value, for example, using "Width" to set width
  745. * @param nValue [IN] Feature value to set
  746. * @return Success, return MV_OK. Failure, return error code
  747. * @remarks You can call this API to get the value of camera node with integer type after connecting the device.
  748. ************************************************************************/
  749. MV_CAMCTRL_API int __stdcall MV_CC_SetIntValueEx(IN void* handle,IN const char* strKey,IN int64_t nValue);
  750. /********************************************************************//**
  751. * @~chinese
  752. * @brief 获取Enum属性值
  753. * @param handle [IN] 设备句柄/采集卡句柄
  754. * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
  755. * @param pstEnumValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  756. * @return 成功,返回MV_OK,失败,返回错误码
  757. * @remarks 连接设备之后调用该接口可以获取Enum类型的指定节点的值。
  758. * @~english
  759. * @brief Get Enum value
  760. * @param handle [IN] Device handle/Frame grabber handle
  761. * @param strKey [IN] Key value, for example, using "PixelFormat" to get pixel format
  762. * @param pstEnumValue [IN][OUT] Structure pointer of camera features
  763. * @return Success, return MV_OK. Failure, return error code
  764. * @remarks After the device is connected, call this interface to get specified Enum nodes.
  765. ************************************************************************/
  766. MV_CAMCTRL_API int __stdcall MV_CC_GetEnumValue(IN void* handle,IN const char* strKey,IN OUT MVCC_ENUMVALUE *pstEnumValue);
  767. /********************************************************************//**
  768. * @~chinese
  769. * @brief 获取Enum属性值
  770. * @param handle [IN] 设备句柄/采集卡句柄
  771. * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
  772. * @param pstEnumValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  773. * @return 成功,返回MV_OK,失败,返回错误码
  774. * @remarks 连接设备之后调用该接口可以获取Enum类型的指定节点的值,区别与MV_CC_GetEnumValue,此接口返回的枚举有效个数扩展到256个。
  775. * @~english
  776. * @brief Get Enum value
  777. * @param handle [IN] Device handle/Frame grabber handle
  778. * @param strKey [IN] Key value, for example, using "PixelFormat" to get pixel format
  779. * @param pstEnumValue [IN][OUT] Structure pointer of camera features
  780. * @return Success, return MV_OK. Failure, return error code
  781. * @remarks After the device is connected, call this interface to get specified Enum nodes.
  782. Comparing with the API MV_CC_GetEnumValue, this API expands the number of enumeration values up to 256.
  783. ************************************************************************/
  784. MV_CAMCTRL_API int __stdcall MV_CC_GetEnumValueEx(IN void* handle, IN const char* strKey, IN OUT MVCC_ENUMVALUE_EX *pstEnumValue);
  785. /********************************************************************//**
  786. * @~chinese
  787. * @brief 设置Enum型属性值
  788. * @param handle [IN] 设备句柄/采集卡句柄
  789. * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
  790. * @param nValue [IN] 想要设置的设备的属性值
  791. * @return 成功,返回MV_OK,失败,返回错误码
  792. * @remarks 连接设备之后调用该接口可以设置Enum类型的指定节点的值。
  793. * @~english
  794. * @brief Set Enum value
  795. * @param handle [IN] Device handle/Frame grabber handle
  796. * @param strKey [IN] Key value, for example, using "PixelFormat" to set pixel format
  797. * @param nValue [IN] Feature value to set
  798. * @return Success, return MV_OK. Failure, return error code
  799. * @remarks After the device is connected, call this interface to set specified Enum nodes.
  800. ************************************************************************/
  801. MV_CAMCTRL_API int __stdcall MV_CC_SetEnumValue(IN void* handle,IN const char* strKey,IN unsigned int nValue);
  802. /********************************************************************//**
  803. * @~chinese
  804. * @brief 获取Enum型节点指定值的符号
  805. * @param handle [IN] 设备句柄/采集卡句柄
  806. * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
  807. * @param pstEnumEntry [IN][OUT] 想要获取的设备的属性符号
  808. * @return 成功,返回MV_OK,失败,返回错误码
  809. * @remarks 连接设备之后调用该接口可以获取Enum类型的指定节点的值所对应的符号。
  810. * @~english
  811. * @brief Get the symbolic of the specified value of the Enum type node
  812. * @param handle [IN] Device handle/Frame grabber handle
  813. * @param strKey [IN] Key value, for example, using "PixelFormat" to set pixel format
  814. * @param pstEnumEntry [IN][OUT] Symbolic to get
  815. * @return Success, return MV_OK. Failure, return error code
  816. * @remarks Call this interface after connecting the device to obtain the symbol corresponding to the value of the specified node of Enum type.
  817. ************************************************************************/
  818. MV_CAMCTRL_API int __stdcall MV_CC_GetEnumEntrySymbolic(IN void* handle,IN const char* strKey,IN OUT MVCC_ENUMENTRY* pstEnumEntry);
  819. /********************************************************************//**
  820. * @~chinese
  821. * @brief 设置Enum型属性值
  822. * @param handle [IN] 设备句柄/采集卡句柄
  823. * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
  824. * @param strValue [IN] 想要设置的设备的属性字符串
  825. * @return 成功,返回MV_OK,失败,返回错误码
  826. * @remarks 连接设备之后调用该接口可以设置Enum类型的指定节点的值。
  827. * @~english
  828. * @brief Set Enum value
  829. * @param handle [IN] Device handle/Frame grabber handle
  830. * @param strKey [IN] Key value, for example, using "PixelFormat" to set pixel format
  831. * @param strValue [IN] Feature String to set
  832. * @return Success, return MV_OK. Failure, return error code
  833. * @remarks After the device is connected, call this interface to set specified Enum nodes.
  834. ************************************************************************/
  835. MV_CAMCTRL_API int __stdcall MV_CC_SetEnumValueByString(IN void* handle,IN const char* strKey,IN const char* strValue);
  836. /********************************************************************//**
  837. * @~chinese
  838. * @brief 获取Float属性值
  839. * @param handle [IN] 设备句柄/采集卡句柄
  840. * @param strKey [IN] 属性键值
  841. * @param pstFloatValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  842. * @return 成功,返回MV_OK,失败,返回错误码
  843. * @remarks 连接设备之后调用该接口可以获取float类型的指定节点的值。
  844. * @~english
  845. * @brief Get Float value
  846. * @param handle [IN] Device handle/Frame grabber handle
  847. * @param strKey [IN] Key value
  848. * @param pstFloatValue [IN][OUT] Structure pointer of camera features
  849. * @return Success, return MV_OK. Failure, return error code
  850. * @remarks After the device is connected, call this interface to get specified float node.
  851. ************************************************************************/
  852. MV_CAMCTRL_API int __stdcall MV_CC_GetFloatValue(IN void* handle,IN const char* strKey,IN OUT MVCC_FLOATVALUE *pstFloatValue);
  853. /********************************************************************//**
  854. * @~chinese
  855. * @brief 设置float型属性值
  856. * @param handle [IN] 设备句柄/采集卡句柄
  857. * @param strKey [IN] 属性键值
  858. * @param fValue [IN] 想要设置的设备的属性值
  859. * @return 成功,返回MV_OK,失败,返回错误码
  860. * @remarks 连接设备之后调用该接口可以设置float类型的指定节点的值。
  861. * @~english
  862. * @brief Set float value
  863. * @param handle [IN] Device handle/Frame grabber handle
  864. * @param strKey [IN] Key value
  865. * @param fValue [IN] Feature value to set
  866. * @return Success, return MV_OK. Failure, return error code
  867. * @remarks After the device is connected, call this interface to set specified float node.
  868. ************************************************************************/
  869. MV_CAMCTRL_API int __stdcall MV_CC_SetFloatValue(IN void* handle,IN const char* strKey,IN float fValue);
  870. /********************************************************************//**
  871. * @~chinese
  872. * @brief 获取Boolean属性值
  873. * @param handle [IN] 设备句柄/采集卡句柄
  874. * @param strKey [IN] 属性键值
  875. * @param pbValue [IN][OUT] 返回给调用者有关设备属性值
  876. * @return 成功,返回MV_OK,失败,返回错误码
  877. * @remarks 连接设备之后调用该接口可以获取bool类型的指定节点的值。
  878. * @~english
  879. * @brief Get Boolean value
  880. * @param handle [IN] Device handle/Frame grabber handle
  881. * @param strKey [IN] Key value
  882. * @param pbValue [IN][OUT] Structure pointer of camera features
  883. * @return Success, return MV_OK. Failure, return error code
  884. * @remarks After the device is connected, call this interface to get specified bool nodes.
  885. ************************************************************************/
  886. MV_CAMCTRL_API int __stdcall MV_CC_GetBoolValue(IN void* handle,IN const char* strKey,IN OUT bool *pbValue);
  887. /********************************************************************//**
  888. * @~chinese
  889. * @brief 设置Boolean型属性值
  890. * @param handle [IN] 设备句柄/采集卡句柄
  891. * @param strKey [IN] 属性键值
  892. * @param bValue [IN] 想要设置的设备的属性值
  893. * @return 成功,返回MV_OK,失败,返回错误码
  894. * @remarks 连接设备之后调用该接口可以设置bool类型的指定节点的值。
  895. * @~english
  896. * @brief Set Boolean value
  897. * @param handle [IN] Device handle/Frame grabber handle
  898. * @param strKey [IN] Key value
  899. * @param bValue [IN] Feature value to set
  900. * @return Success, return MV_OK. Failure, return error code
  901. * @remarks After the device is connected, call this interface to set specified bool nodes.
  902. ************************************************************************/
  903. MV_CAMCTRL_API int __stdcall MV_CC_SetBoolValue(IN void* handle,IN const char* strKey,IN bool bValue);
  904. /********************************************************************//**
  905. * @~chinese
  906. * @brief 获取String属性值
  907. * @param handle [IN] 设备句柄/采集卡句柄
  908. * @param strKey [IN] 属性键值
  909. * @param pstStringValue [IN][OUT] 返回给调用者有关设备属性结构体指针
  910. * @return 成功,返回MV_OK,失败,返回错误码
  911. * @remarks 连接设备之后调用该接口可以获取string类型的指定节点的值。
  912. * @~english
  913. * @brief Get String value
  914. * @param handle [IN] Device handle/Frame grabber handle
  915. * @param strKey [IN] Key value
  916. * @param pstStringValue [IN][OUT] Structure pointer of camera features
  917. * @return Success, return MV_OK. Failure, return error code
  918. * @remarks After the device is connected, call this interface to get specified string nodes.
  919. ************************************************************************/
  920. MV_CAMCTRL_API int __stdcall MV_CC_GetStringValue(IN void* handle,IN const char* strKey,IN OUT MVCC_STRINGVALUE *pstStringValue);
  921. /********************************************************************//**
  922. * @~chinese
  923. * @brief 设置String型属性值
  924. * @param handle [IN] 设备句柄/采集卡句柄
  925. * @param strKey [IN] 属性键值
  926. * @param strValue [IN] 想要设置的设备的属性值
  927. * @return 成功,返回MV_OK,失败,返回错误码
  928. * @remarks 连接设备之后调用该接口可以设置string类型的指定节点的值。
  929. * @~english
  930. * @brief Set String value
  931. * @param handle [IN] Device handle/Frame grabber handle
  932. * @param strKey [IN] Key value
  933. * @param strValue [IN] Feature value to set
  934. * @return Success, return MV_OK. Failure, return error code
  935. * @remarks After the device is connected, call this interface to set specified string nodes.
  936. ************************************************************************/
  937. MV_CAMCTRL_API int __stdcall MV_CC_SetStringValue(IN void* handle,IN const char* strKey,IN const char* strValue);
  938. /********************************************************************//**
  939. * @~chinese
  940. * @brief 设置Command型属性值
  941. * @param handle [IN] 设备句柄/采集卡句柄
  942. * @param strKey [IN] 属性键值
  943. * @return 成功,返回MV_OK,失败,返回错误码
  944. * @remarks 连接设备之后调用该接口可以设置指定的Command类型节点。
  945. * @~english
  946. * @brief Send Command
  947. * @param handle [IN] Device handle/Frame grabber handle
  948. * @param strKey [IN] Key value
  949. * @return Success, return MV_OK. Failure, return error code
  950. * @remarks After the device is connected, call this interface to set specified Command nodes.
  951. ************************************************************************/
  952. MV_CAMCTRL_API int __stdcall MV_CC_SetCommandValue(IN void* handle,IN const char* strKey);
  953. /********************************************************************//**
  954. * @~chinese
  955. * @brief 读内存
  956. * @param handle [IN] 设备句柄/采集卡句柄
  957. * @param pBuffer [IN][OUT] 作为返回值使用,保存读到的内存值(GEV设备内存值是按照大端模式存储的,采集卡设备和采集卡下相机按照大端存储,其它协议设备按照小端存储)
  958. * @param nAddress [IN] 待读取的内存地址,该地址可以从设备的Camera.xml文件中获取,形如xxx_RegAddr的xml节点值
  959. * @param nLength [IN] 待读取的内存长度
  960. * @return 成功,返回MV_OK,失败,返回错误码
  961. * @remarks 访问设备,读取某段寄存器的数据。
  962. * @~english
  963. * @brief Read Memory
  964. * @param handle [IN] Device Handle/Frame grabber handle
  965. * @param pBuffer [IN][OUT] Used as a return value, save the read-in memory value ( The memory value of GEV devices is stored in the big end mode, with the capture card device and the camera under the capture card stored in the big end mode, and other protocol devices stored in the small end mode)
  966. * @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
  967. * @param nLength [IN] Length of the memory to be read
  968. * @return Success, return MV_OK. Failure, return error code
  969. * @remarks Access device, read the data from certain register.
  970. *************************************************************************/
  971. MV_CAMCTRL_API int __stdcall MV_CC_ReadMemory(IN void* handle , IN OUT void *pBuffer, IN int64_t nAddress, IN int64_t nLength);
  972. /********************************************************************//**
  973. * @~chinese
  974. * @brief 写内存
  975. * @param handle [IN] 设备句柄/采集卡句柄
  976. * @param pBuffer [IN] 待写入的内存值(注意GEV设备内存值要按照大端模式存储,采集卡设备和采集卡下相机按照大端存储,其它协议设备按照小端存储)
  977. * @param nAddress [IN] 待写入的内存地址,该地址可以从设备的Camera.xml文件中获取,形如xxx_RegAddr的xml节点值
  978. * @param nLength [IN] 待写入的内存长度
  979. * @return 成功,返回MV_OK,失败,返回错误码
  980. * @remarks 访问设备,把一段数据写入某段寄存器。
  981. * @~english
  982. * @brief Write Memory
  983. * @param handle [IN] Device Handle/Frame grabber handle
  984. * @param pBuffer [IN] Memory value to be written ( Note The memory value of GEV devices is stored in the big end mode, with the capture card device and the camera under the capture card stored in the big end mode, and other protocol devices stored in the small end mode)
  985. * @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
  986. * @param nLength [IN] Length of the memory to be written
  987. * @return Success, return MV_OK. Failure, return error code
  988. * @remarks Access device, write a piece of data into a certain segment of register.
  989. ************************************************************************/
  990. MV_CAMCTRL_API int __stdcall MV_CC_WriteMemory(IN void* handle, IN const void *pBuffer, IN int64_t nAddress, IN int64_t nLength);
  991. /********************************************************************//**
  992. * @~chinese
  993. * @brief 清除GenICam节点缓存
  994. * @param handle [IN] 设备句柄/采集卡句柄
  995. * @return 成功,返回MV_OK;错误,返回错误码
  996. * @~english
  997. * @brief Invalidate GenICam Nodes
  998. * @param handle [IN] Device handle/Frame grabber handle
  999. * @return Success, return MV_OK. Failure, return error code
  1000. ************************************************************************/
  1001. MV_CAMCTRL_API int __stdcall MV_CC_InvalidateNodes(IN void* handle);
  1002. /********************************************************************//**
  1003. * @~chinese
  1004. * @brief 获取设备属性树XML
  1005. * @param handle [IN] 设备句柄/采集卡句柄
  1006. * @param pData [IN][OUT] XML数据接收缓存
  1007. * @param nDataSize [IN] 接收缓存大小
  1008. * @param pnDataLen [IN][OUT] 实际数据大小
  1009. * @return 成功,返回MV_OK;错误,返回错误码
  1010. * @remarks 当pData为NULL或nDataSize比实际的xml文件小时,不拷贝数据,由pnDataLen返回xml文件大小
  1011. 当pData为有效缓存地址,且缓存足够大时,拷贝完整数据保存在该缓存里面,并由pnDataLen返回xml文件实际大小。
  1012. * @~english
  1013. * @brief Get camera feature tree XML
  1014. * @param handle [IN] Device handle/Frame grabber handle
  1015. * @param pData [IN][OUT] XML data receiving buffer
  1016. * @param nDataSize [IN] Buffer size
  1017. * @param pnDataLen [IN][OUT] Actual data length
  1018. * @return Success, return MV_OK. Failure, return error code
  1019. * @remarks When pData is NULL or nDataSize than the actual XML file hours, do not copy the data, returned by pnDataLen XML file size.
  1020. 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.
  1021. ***********************************************************************/
  1022. MV_CAMCTRL_API int __stdcall MV_XML_GetGenICamXML(IN void* handle, IN OUT unsigned char* pData, IN unsigned int nDataSize, IN OUT unsigned int* pnDataLen);
  1023. /********************************************************************//**
  1024. * @~chinese
  1025. * @brief 获得当前节点的访问模式
  1026. * @param handle [IN] 设备句柄/采集卡句柄
  1027. * @param strName [IN] 节点名称
  1028. * @param penAccessMode [IN][OUT] 节点的访问模式
  1029. * @return 成功,返回MV_OK;错误,返回错误码
  1030. * @~english
  1031. * @brief Get Access mode of cur node
  1032. * @param handle [IN] Device handle/Frame grabber handle
  1033. * @param strName [IN] Name of node
  1034. * @param penAccessMode [IN][OUT] Access mode of the node
  1035. * @return Success, return MV_OK. Failure, return error code
  1036. ***********************************************************************/
  1037. MV_CAMCTRL_API int __stdcall MV_XML_GetNodeAccessMode(IN void* handle, IN const char * strName, IN OUT enum MV_XML_AccessMode *penAccessMode);
  1038. /********************************************************************//**
  1039. * @~chinese
  1040. * @brief 获得当前节点的类型
  1041. * @param handle [IN] 设备句柄/采集卡句柄
  1042. * @param strName [IN] 节点名称
  1043. * @param penInterfaceType [IN][OUT] 节点的类型
  1044. * @return 成功,返回MV_OK;错误,返回错误码
  1045. * @remarks 该接口可以在调用万能接口之前,提前知道节点类型,方便用户选择合适的万能接口进行节点值的设置和获取。
  1046. * @~english
  1047. * @brief Get Interface Type of cur node
  1048. * @param handle [IN] Device handle/Frame grabber handle
  1049. * @param strName [IN] Name of node
  1050. * @param penInterfaceType [IN][OUT] Interface Type of the node
  1051. * @return Success, return MV_OK. Failure, return error code
  1052. * @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.
  1053. ***********************************************************************/
  1054. MV_CAMCTRL_API int __stdcall MV_XML_GetNodeInterfaceType(IN void* handle, IN const char * strName, IN OUT enum MV_XML_InterfaceType *penInterfaceType);
  1055. /********************************************************************//**
  1056. * @~chinese
  1057. * @brief 保存设备属性
  1058. * @param handle [IN] 设备句柄/采集卡句柄
  1059. * @param strFileName [IN] 属性文件名
  1060. * @return 成功,返回MV_OK;错误,返回错误码
  1061. * @~english
  1062. * @brief Save camera feature
  1063. * @param handle [IN] Device handle/Frame grabber handle
  1064. * @param strFileName [IN] File name
  1065. * @return Success, return MV_OK. Failure, return error code
  1066. ************************************************************************/
  1067. MV_CAMCTRL_API int __stdcall MV_CC_FeatureSave(IN void* handle, IN const char* strFileName);
  1068. /********************************************************************//**
  1069. * @~chinese
  1070. * @brief 导入设备属性
  1071. * @param handle [IN] 设备句柄/采集卡句柄
  1072. * @param strFileName [IN] 属性文件名
  1073. * @return 成功,返回MV_OK;错误,返回错误码
  1074. * @~english
  1075. * @brief Load camera feature
  1076. * @param handle [IN] Device handle/Frame grabber handle
  1077. * @param strFileName [IN] File name
  1078. * @return Success, return MV_OK. Failure, return error code
  1079. ************************************************************************/
  1080. MV_CAMCTRL_API int __stdcall MV_CC_FeatureLoad(IN void* handle, IN const char* strFileName);
  1081. /********************************************************************//**
  1082. * @~chinese
  1083. * @brief 导入设备属性并保存错误信息列表
  1084. * @param handle [IN] 设备句柄/采集卡句柄
  1085. * @param strFileName [IN] 属性文件名
  1086. * @param stNodeErrorList [IN OUT] 错误信息列表,由用户在外部申请并由内部填充数据,该参数允许填null代表用户不关心导入时的错误信息
  1087. * @return 成功,返回MV_OK;错误,返回错误码
  1088. * @remarks 部分节点导入失败时,接口返回MV_OK,通过错误信息列表中stNodeError获取出错节点及失败原因
  1089. * @~english
  1090. * @brief Load camera feature with error message list
  1091. * @param handle [IN] Device handle/Frame grabber handle
  1092. * @param strFileName [IN] File name
  1093. * @param pstNodeErrorList [IN OUT] Error message list, requested by the user externally and filled with data internally, \n
  1094. * this parameter allows null to indicate that the user is not concerned about error information during import.
  1095. * @return Success, return MV_OK. Failure, return error code
  1096. * @remarks When some nodes fail to load, the interface returns MV_OK. \n
  1097. * The error node and the reason for the failure are obtained through stNodeError in the error message list.
  1098. ************************************************************************/
  1099. MV_CAMCTRL_API int __stdcall MV_CC_FeatureLoadEx(IN void* handle, IN const char* strFileName, IN OUT MVCC_NODE_ERROR_LIST* pstNodeErrorList);
  1100. /********************************************************************//**
  1101. * @~chinese
  1102. * @brief 从设备读取文件
  1103. * @param handle [IN] 设备句柄/采集卡句柄
  1104. * @param pstFileAccess [IN] 文件存取结构体
  1105. * @return 成功,返回MV_OK;错误,返回错误码
  1106. * @~english
  1107. * @brief Read the file from the camera
  1108. * @param handle [IN] Device handle/Frame grabber handle
  1109. * @param pstFileAccess [IN] File access structure
  1110. * @return Success, return MV_OK. Failure, return error code
  1111. ************************************************************************/
  1112. MV_CAMCTRL_API int __stdcall MV_CC_FileAccessRead(IN void* handle, IN MV_CC_FILE_ACCESS * pstFileAccess);
  1113. /********************************************************************//**
  1114. * @~chinese
  1115. * @brief 从设备读取文件,文件是Data数据
  1116. * @param handle [IN] 设备句柄/采集卡句柄
  1117. * @param pstFileAccess [IN] 文件存取结构体
  1118. * @return 成功,返回MV_OK;错误,返回错误码 避免文件操作权限问题读失败
  1119. * @~english
  1120. * @brief Read the file data from the camera
  1121. * @param handle [IN] Device handle/Frame grabber handle
  1122. * @param pstFileAccess [IN] File access structure
  1123. * @return Success, return MV_OK. Failure, return error code
  1124. ************************************************************************/
  1125. MV_CAMCTRL_API int __stdcall MV_CC_FileAccessReadEx(IN void* handle, IN OUT MV_CC_FILE_ACCESS_EX * pstFileAccessEx);
  1126. /********************************************************************//**
  1127. * @~chinese
  1128. * @brief 将文件写入设备
  1129. * @param handle [IN] 设备句柄/采集卡句柄
  1130. * @param pstFileAccess [IN] 文件存取结构体
  1131. * @return 成功,返回MV_OK;错误,返回错误码
  1132. * @~english
  1133. * @brief Write the file to camera
  1134. * @param handle [IN] Device handle/Frame grabber handle
  1135. * @param pstFileAccess [IN] File access structure
  1136. * @return Success, return MV_OK. Failure, return error code
  1137. ************************************************************************/
  1138. MV_CAMCTRL_API int __stdcall MV_CC_FileAccessWrite(IN void* handle, IN MV_CC_FILE_ACCESS * pstFileAccess);
  1139. /********************************************************************//**
  1140. * @~chinese
  1141. * @brief 将缓存(buffer)写入设备
  1142. * @param handle [IN] 设备句柄/采集卡句柄
  1143. * @param pstFileAccessEx [IN][OUT] 文件存取结构体
  1144. * @return 成功,返回MV_OK;错误,返回错误码
  1145. * @remarks 该接口直接使用缓存数据,进行读写操作,避免直接操作文件出现无权限的问题,是MV_CC_FileAccessWrite的扩展接口
  1146. * @~english
  1147. * @brief Write the data(buffer) to camera
  1148. * @param handle [IN] Device handle/Frame grabber handle
  1149. * @param pstFileAccessEx [IN][OUT] File access structure
  1150. * @return Success, return MV_OK. Failure, return error code
  1151. * @remarks This interface uses cached data for read and write,solve the problem of no permissions in direct operation files, it's an extended interface of MV_CC_FileAccessWrite.
  1152. ************************************************************************/
  1153. MV_CAMCTRL_API int __stdcall MV_CC_FileAccessWriteEx(IN void* handle, IN OUT MV_CC_FILE_ACCESS_EX * pstFileAccessEx);
  1154. /********************************************************************//**
  1155. * @~chinese
  1156. * @brief 获取文件存取的进度
  1157. * @param handle [IN] 设备句柄/采集卡句柄
  1158. * @param pstFileAccessProgress [IN][OUT] 进度内容
  1159. * @return 成功,返回MV_OK;错误,返回错误码 (当前文件存取的状态)
  1160. * @~english
  1161. * @brief Get File Access Progress
  1162. * @param handle [IN] Device handle/Frame grabber handle
  1163. * @param pstFileAccessProgress [IN][OUT] File access Progress
  1164. * @return Success, return MV_OK. Failure, return error code
  1165. ************************************************************************/
  1166. MV_CAMCTRL_API int __stdcall MV_CC_GetFileAccessProgress(IN void* handle, IN OUT MV_CC_FILE_ACCESS_PROGRESS * pstFileAccessProgress);
  1167. /*******************Part5 ch: 相机和采集卡 升级 | en: Camera /Frame grabber upgrade *******************/
  1168. /********************************************************************//**
  1169. * @~chinese
  1170. * @brief 设备本地升级
  1171. * @param handle [IN] 设备句柄
  1172. * @param strFilePathName [IN] 文件名
  1173. * @return 成功,返回MV_OK,失败,返回错误码
  1174. * @remarks 通过该接口可以将升级固件文件发送给设备进行升级。
  1175. 该接口需要等待升级固件文件成功传给设备端之后再返回,响应时间可能较长。
  1176. * @~english
  1177. * @brief Device Local Upgrade
  1178. * @param handle [IN] Device handle
  1179. * @param strFilePathName [IN] File name
  1180. * @return Success, return MV_OK. Failure, return error code
  1181. * @remarks Call this API to send the upgrade firmware to the device for upgrade.
  1182. This API will wait for return until the upgrade firmware is sent to the device, this response may take a long time.
  1183. For CameraLink device, it keeps sending upgrade firmware continuously.
  1184. ************************************************************************/
  1185. MV_CAMCTRL_API int __stdcall MV_CC_LocalUpgrade(IN void* handle, IN const void* strFilePathName);
  1186. /********************************************************************//**
  1187. * @~chinese
  1188. * @brief 获取升级进度
  1189. * @param handle [IN] 设备句柄
  1190. * @param pnProcess [IN][OUT] 进度接收地址
  1191. * @return 成功,返回MV_OK,失败,返回错误码
  1192. * @~english
  1193. * @brief Get Upgrade Progress
  1194. * @param handle [IN] Device handle
  1195. * @param pnProcess [IN][OUT] Progress receiving address
  1196. * @return Success, return MV_OK. Failure, return error code
  1197. ************************************************************************/
  1198. MV_CAMCTRL_API int __stdcall MV_CC_GetUpgradeProcess(IN void* handle, IN OUT unsigned int* pnProcess);
  1199. /*******************Part6 ch: 相机和采集卡 注册异常回调和事件接口 | en: Camera /Frame Enrol abnormal callbacks and event interface*******************/
  1200. /********************************************************************//**
  1201. * @~chinese
  1202. * @brief 注册异常消息回调,在打开设备之后调用
  1203. * @param handle [IN] 设备句柄
  1204. * @param cbException [IN] 异常回调函数指针
  1205. * @param pUser [IN] 用户自定义变量
  1206. * @return 成功,返回MV_OK,失败,返回错误码
  1207. * @remarks 该接口需要在MV_CC_OpenDevice打开设备之后调用。
  1208. 设备异常断开连接后可以在回调里面获取到异常消息,设备掉线之后需要先释放相机句柄,然后重新枚举并创建相机句柄,再调用MV_CC_OpenDevice接口重新打开设备。
  1209. * @~english
  1210. * @brief Register Exception Message CallBack, call after open device
  1211. * @param handle [IN] Device handle
  1212. * @param cbException [IN] Exception Message CallBack Function Pointer
  1213. * @param pUser [IN] User defined variable
  1214. * @return Success, return MV_OK. Failure, return error code
  1215. * @remarks Call this interface after the device is opened by MV_CC_OpenDevice.
  1216. When device is exceptionally disconnected, the exception message can be obtained from callback function. For Disconnected device,
  1217. first call MV_CC_DestroyHandle to release device, and then enum device and create device handle, and then call MV_CC_OpenDevice to reopen the device.
  1218. ************************************************************************/
  1219. MV_CAMCTRL_API int __stdcall MV_CC_RegisterExceptionCallBack(IN void* handle, IN void(__stdcall* cbException)(unsigned int nMsgType, void* pUser), IN void* pUser);
  1220. /********************************************************************//**
  1221. * @~chinese
  1222. * @brief 注册全部事件回调,在打开设备之后调用
  1223. * @param handle [IN] 设备句柄
  1224. * @param cbEvent [IN] 事件回调函数指针
  1225. * @param pUser [IN] 用户自定义变量
  1226. * @return 成功,返回MV_OK,失败,返回错误码
  1227. * @remarks 通过该接口设置事件回调,可以在回调函数里面获取采集、曝光等事件信息
  1228. 该接口不支持CameraLink设备。
  1229. * @~english
  1230. * @brief Register event callback, which is called after the device is opened
  1231. * @param handle [IN] Device handle
  1232. * @param cbEvent [IN] Event CallBack Function Pointer
  1233. * @param pUser [IN] User defined variable
  1234. * @return Success, return MV_OK. Failure, return error code
  1235. * @remarks Call this API to set the event callback function to get the event information, e.g., acquisition, exposure, and so on
  1236. This API is not supported by CameraLink device.
  1237. ************************************************************************/
  1238. MV_CAMCTRL_API int __stdcall MV_CC_RegisterAllEventCallBack(IN void* handle, IN void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser), IN void* pUser);
  1239. /********************************************************************//**
  1240. * @~chinese
  1241. * @brief 注册单个事件回调,在打开设备之后调用
  1242. * @param handle [IN] 设备句柄
  1243. * @param strEventName [IN] 事件名称
  1244. * @param cbEvent [IN] 事件回调函数指针
  1245. * @param pUser [IN] 用户自定义变量
  1246. * @return 成功,返回MV_OK,失败,返回错误码
  1247. * @remarks 通过该接口设置事件回调,可以在回调函数里面获取采集、曝光等事件信息。
  1248. 该接口不支持CameraLink设备。
  1249. * @~english
  1250. * @brief Register single event callback, which is called after the device is opened
  1251. * @param handle [IN] Device handle
  1252. * @param strEventName [IN] Event name
  1253. * @param cbEvent [IN] Event CallBack Function Pointer
  1254. * @param pUser [IN] User defined variable
  1255. * @return Success, return MV_OK. Failure, return error code
  1256. * @remarks Call this API to set the event callback function to get the event information, e.g., acquisition, exposure, and so on.
  1257. This API is not supported by CameraLink device .
  1258. ************************************************************************/
  1259. MV_CAMCTRL_API int __stdcall MV_CC_RegisterEventCallBackEx(IN void* handle, IN const char* strEventName, IN void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser), IN void* pUser);
  1260. /********************************************************************//**
  1261. * @~chinese
  1262. * @brief 开启设备指定事件
  1263. * @param handle [IN] 设备句柄
  1264. * @param strEventName [IN] 事件名称
  1265. * @return 成功,返回MV_OK,失败,返回错误码
  1266. * @~english
  1267. * @brief Enable specified event of device
  1268. * @param handle [IN] Device handle
  1269. * @param strEventName [IN] Event name
  1270. * @return Success, return MV_OK. Failure, return error code
  1271. ************************************************************************/
  1272. MV_CAMCTRL_API int __stdcall MV_CC_EventNotificationOn(IN void* handle, IN const char* strEventName);
  1273. /********************************************************************//**
  1274. * @~chinese
  1275. * @brief 关闭设备指定事件
  1276. * @param handle [IN] 设备句柄
  1277. * @param strEventName [IN] 事件名称
  1278. * @return 成功,返回MV_OK,失败,返回错误码
  1279. * @~english
  1280. * @brief Disable specified event of device
  1281. * @param handle [IN] Device handle
  1282. * @param strEventName [IN] Event name
  1283. * @return Success, return MV_OK. Failure, return error code
  1284. ************************************************************************/
  1285. MV_CAMCTRL_API int __stdcall MV_CC_EventNotificationOff(IN void* handle, IN const char* strEventName);
  1286. /*******************Part7 ch: 仅GigE设备支持的接口 | en: Only support GigE interface*******************/
  1287. /********************************************************************//**
  1288. * @~chinese
  1289. * @brief 设置枚举超时时间,仅支持GigE协议,范围:[1, UINT_MAX)
  1290. * @param nMilTimeout [IN] 超时时间,应为无符号整数,默认100ms
  1291. * @return 成功,返回MV_OK;错误,返回错误码
  1292. * @remarks 在调用MV_CC_EnumDevices等枚举接口前使用该接口,可设置枚举GIGE设备的网卡最大超时时间(默认100ms),可以减少最大超时时间,来加快枚举GIGE设备的速度
  1293. * @remarks 仅支持GigEVision设备。
  1294. * @~english
  1295. * @brief Set enumerate device timeout,only support GigE,range:[1, UINT_MAX)
  1296. * @param nMilTimeout [IN] time out,input of unsigned int,default 100ms
  1297. * @return Success, return MV_OK. Failure, return error code
  1298. * @remarks Before calling enum device interfaces,call MV_GIGE_SetEnumDevTimeout to set max timeout,can reduce the maximum timeout to speed up the enumeration of GigE devices.
  1299. * @remarks This API only support GigE Vision Device.
  1300. ************************************************************************/
  1301. MV_CAMCTRL_API int __stdcall MV_GIGE_SetEnumDevTimeout(IN unsigned int nMilTimeout);
  1302. /********************************************************************//**
  1303. * @~chinese
  1304. * @brief 强制IP
  1305. * @param handle [IN] 设备句柄
  1306. * @param nIP [IN] 设置的IP
  1307. * @param nSubNetMask [IN] 子网掩码
  1308. * @param nDefaultGateWay [IN] 默认网关
  1309. * @return 成功,返回MV_OK,失败,返回错误码
  1310. * @remarks 强制设置设备网络参数(包括IP、子网掩码、默认网关),强制设置之后将需要重新创建设备句柄,支持GigEVision(MV_GIGE_DEVICE)设备和GenTL(MV_GENTL_GIGE_DEVICE)设备
  1311. 如果设备为DHCP的状态,调用该接口强制设置设备网络参数之后设备将会重启。
  1312. * @~english
  1313. * @brief Force IP
  1314. * @param handle [IN] Device handle
  1315. * @param nIP [IN] IP to set
  1316. * @param nSubNetMask [IN] Subnet mask
  1317. * @param nDefaultGateWay [IN] Default gateway
  1318. * @return Success, return MV_OK. Failure, return error code
  1319. * @remarks Force setting camera network parameter (including IP address, subnet mask, default gateway). After forced setting, device handle should be created again.
  1320. This API support GigEVision(MV_GIGE_DEVICE) and GenTL(MV_GENTL_GIGE_DEVICE) device.
  1321. If device is in DHCP status, after calling this API to force setting camera network parameter, the device will restart.
  1322. ************************************************************************/
  1323. MV_CAMCTRL_API int __stdcall MV_GIGE_ForceIpEx(IN void* handle, IN unsigned int nIP, IN unsigned int nSubNetMask, IN unsigned int nDefaultGateWay);
  1324. /********************************************************************//**
  1325. * @~chinese
  1326. * @brief 配置IP方式
  1327. * @param handle [IN] 设备句柄
  1328. * @param nType [IN] IP类型,见MV_IP_CFG_x
  1329. * @return 成功,返回MV_OK,失败,返回错误码
  1330. * @remarks 发送命令设置设备的IP方式,如DHCP、LLA等,仅支持GigEVision(MV_GIGE_DEVICE)和GenTl(MV_GENTL_GIGE_DEVICE)的设备。
  1331. * @~english
  1332. * @brief IP configuration method
  1333. * @param handle [IN] Device handle
  1334. * @param nType [IN] IP type, refer to MV_IP_CFG_x
  1335. * @return Success, return MV_OK. Failure, return error code
  1336. * @remarks Send command to set camera IP mode, such as DHCP and LLA, only supported by GigEVision(MV_GIGE_DEVICE) and GenTL(MV_GENTL_GIGE_DEVICE) Device.
  1337. ************************************************************************/
  1338. MV_CAMCTRL_API int __stdcall MV_GIGE_SetIpConfig(IN void* handle, IN unsigned int nType);
  1339. /********************************************************************//**
  1340. * @~chinese
  1341. * @brief 设置仅使用某种模式,type: MV_NET_TRANS_x,不设置时,默认优先使用driver
  1342. * @param handle [IN] 设备句柄
  1343. * @param nType [IN] 网络传输模式,见MV_NET_TRANS_x
  1344. * @return 成功,返回MV_OK,失败,返回错误码
  1345. * @remarks 通过该接口可以设置SDK内部优先使用的网络模式,默认优先使用驱动模式,仅GigEVision设备支持。
  1346. * @~english
  1347. * @brief Set to use only one mode,type: MV_NET_TRANS_x. When do not set, priority is to use driver by default
  1348. * @param handle [IN] Device handle
  1349. * @param nType [IN] Net transmission mode, refer to MV_NET_TRANS_x
  1350. * @return Success, return MV_OK. Failure, return error code
  1351. * @remarksSet SDK internal priority network mode through this interface, drive mode by default, only supported by GigEVision camera.
  1352. ************************************************************************/
  1353. MV_CAMCTRL_API int __stdcall MV_GIGE_SetNetTransMode(IN void* handle, IN unsigned int nType);
  1354. /********************************************************************//**
  1355. * @~chinese
  1356. * @brief 获取网络传输信息
  1357. * @param handle [IN] 设备句柄
  1358. * @param pstInfo [IN][OUT] 信息结构体
  1359. * @return 成功,返回MV_OK,失败,返回错误码
  1360. * @remarks 通过该接口可以获取网络传输相关信息,包括已接收数据大小、丢帧数量等,在MV_CC_StartGrabbing开启采集之后调用。仅GigEVision设备支持。
  1361. * @~english
  1362. * @brief Get net transmission information
  1363. * @param handle [IN] Device handle
  1364. * @param pstInfo [IN][OUT] Information Structure
  1365. * @return Success, return MV_OK. Failure, return error code
  1366. * @remarks Get network transmission information through this API, including received data size, number of lost frames.
  1367. Call this API after starting image acquiring through MV_CC_StartGrabbing. This API is supported only by GigEVision Camera.
  1368. ************************************************************************/
  1369. MV_CAMCTRL_API int __stdcall MV_GIGE_GetNetTransInfo(IN void* handle, IN OUT MV_NETTRANS_INFO* pstInfo);
  1370. /********************************************************************//**
  1371. * @~chinese
  1372. * @brief 设置枚举命令的回复包类型
  1373. * @param nMode [IN] 回复包类型(默认广播),0-单播,1-广播
  1374. * @return 成功,返回MV_OK;错误,返回错误码
  1375. * @remarks 该接口只对GigE相机有效。
  1376. * @~english
  1377. * @brief Setting the ACK mode of devices Discovery.
  1378. * @param nMode [IN] ACK mode(Default-Broadcast),0-Unicast,1-Broadcast.
  1379. * @return Success, return MV_OK. Failure, return error code
  1380. * @remarks This interface is ONLY effective on GigE cameras.
  1381. ************************************************************************/
  1382. MV_CAMCTRL_API int __stdcall MV_GIGE_SetDiscoveryMode(IN unsigned int nMode);
  1383. /********************************************************************//**
  1384. * @~chinese
  1385. * @brief 设置GVSP取流超时时间
  1386. * @param handle [IN] 设备句柄
  1387. * @param nMillisec [IN] 超时时间,默认30ms,范围:[10 - UINT_MAX)
  1388. * @return 成功,返回MV_OK;错误,返回错误码
  1389. * @remarks 连接设备之后,取流动作发生前,调用该接口可以设置GVSP取流超时时间。GVSP取流超时设置过短可能造成图像异常,设置过长可能造成取流时间变长。
  1390. * @~english
  1391. * @brief Set GVSP streaming timeout
  1392. * @param handle [IN] Device handle
  1393. * @param nMillisec [IN] Timeout, default 30ms, range:[10 - UINT_MAX)
  1394. * @return Success, return MV_OK. Failure, return error code
  1395. * @remarks After the device is connected, and just before start streaming,
  1396. * call this interface to set GVSP streaming timeout value.
  1397. ************************************************************************/
  1398. MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvspTimeout(IN void* handle, IN unsigned int nMillisec);
  1399. /********************************************************************//**
  1400. * @~chinese
  1401. * @brief 获取GVSP取流超时时间
  1402. * @param handle [IN] 设备句柄
  1403. * @param pnMillisec [IN][OUT] 超时时间指针,以毫秒为单位
  1404. * @return 成功,返回MV_OK;错误,返回错误码
  1405. * @remarks 该接口用于获取当前的GVSP取流超时时间
  1406. * @~english
  1407. * @brief Get GVSP streaming timeout
  1408. * @param handle [IN] Device handle
  1409. * @param pnMillisec [IN][OUT] Timeout, ms as unit
  1410. * @return Success, return MV_OK. Failure, return error code
  1411. * @remarks This interface is used to get the current GVSP streaming timeout.
  1412. ************************************************************************/
  1413. MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvspTimeout(IN void* handle, IN OUT unsigned int* pnMillisec);
  1414. /********************************************************************//**
  1415. * @~chinese
  1416. * @brief 设置GVCP命令超时时间
  1417. * @param handle [IN] 设备句柄
  1418. * @param nMillisec [IN] 超时时间(ms),默认500ms,范围:[0,10000]
  1419. * @return 成功,返回MV_OK;错误,返回错误码
  1420. * @remarks 连接设备之后调用该接口可以设置GVCP命令超时时间。
  1421. * @~english
  1422. * @brief Set GVCP cammand timeout
  1423. * @param handle [IN] Device handle
  1424. * @param nMillisec [IN] Timeout(ms), default 500ms, range: [0,10000]
  1425. * @return Success, return MV_OK. Failure, return error code
  1426. * @remarks The API can set GVCP command timeout(ms) after device is connected .
  1427. ************************************************************************/
  1428. MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvcpTimeout(IN void* handle, IN unsigned int nMillisec);
  1429. /********************************************************************//**
  1430. * @~chinese
  1431. * @brief 获取GVCP命令超时时间
  1432. * @param handle [IN] 设备句柄
  1433. * @param pnMillisec [IN][OUT] 超时时间指针,以毫秒为单位
  1434. * @return 成功,返回MV_OK;错误,返回错误码
  1435. * @remarks 该接口用于获取当前的GVCP超时时间。
  1436. * @~english
  1437. * @brief Get GVCP cammand timeout
  1438. * @param handle [IN] Device handle
  1439. * @param pnMillisec [IN][OUT] Timeout, ms as unit
  1440. * @return Success, return MV_OK. Failure, return error code
  1441. * @remarks This interface is used to get the current GVCP timeout.
  1442. ************************************************************************/
  1443. MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvcpTimeout(IN void* handle, IN OUT unsigned int* pnMillisec);
  1444. /********************************************************************//**
  1445. * @~chinese
  1446. * @brief 设置重传GVCP命令次数
  1447. * @param handle [IN] 设备句柄
  1448. * @param nRetryGvcpTimes [IN] 重传次数,范围:0-100
  1449. * @return 成功,返回MV_OK;错误,返回错误码
  1450. * @remarks 该接口用于在GVCP包传输异常时,增加重传的次数,在一定程度上可以避免设备掉线,范围为0-100。
  1451. * @~english
  1452. * @brief Set the number of retry GVCP cammand
  1453. * @param handle [IN] Device handle
  1454. * @param nRetryGvcpTimes [IN] The number of retries,rang:0-100
  1455. * @return Success, return MV_OK. Failure, return error code
  1456. * @remarks This interface is used to increase The Times of retransmission when GVCP packet transmission is abnormal,and to some extent,
  1457. it can avoid dropping the camera, with a range of 0-100.
  1458. ************************************************************************/
  1459. MV_CAMCTRL_API int __stdcall MV_GIGE_SetRetryGvcpTimes(IN void* handle, IN unsigned int nRetryGvcpTimes);
  1460. /********************************************************************//**
  1461. * @~chinese
  1462. * @brief 获取重传GVCP命令次数
  1463. * @param handle [IN] 设备句柄
  1464. * @param pnRetryGvcpTimes [IN][OUT] 重传次数指针
  1465. * @return 成功,返回MV_OK;错误,返回错误码
  1466. * @remarks 该接口用于获取当前的GVCP重传次数,默认3次。
  1467. * @~english
  1468. * @brief Get the number of retry GVCP cammand
  1469. * @param handle [IN] Device handle
  1470. * @param pnRetryGvcpTimes [IN][OUT] The number of retries
  1471. * @return Success, return MV_OK. Failure, return error code
  1472. * @remarks This interface is used to get the current number of GVCP retransmissions, which defaults to 3.
  1473. ************************************************************************/
  1474. MV_CAMCTRL_API int __stdcall MV_GIGE_GetRetryGvcpTimes(IN void* handle, IN OUT unsigned int* pnRetryGvcpTimes);
  1475. /********************************************************************//**
  1476. * @~chinese
  1477. * @brief 获取最佳的packet size,该接口目前只支持GigE设备
  1478. * @param handle [IN] 设备句柄
  1479. * @return 最佳packetsize
  1480. * @remarks 获取最佳的packet size,对应GigEVision设备是SCPS。
  1481. 该接口需要在MV_CC_OpenDevice之后、MV_CC_StartGrabbing之前调用。
  1482. 该接口不支持CameraLink设备、U3V设备。
  1483. 该接口不支持GenTL设备(协议不支持),如果是GenTL方式添加的网口相机,建议根据网络实际情况配置GevSCPSPacketSize,或者配置1500。
  1484. * @~english
  1485. * @brief Get the optimal Packet Size, Only support GigE Camera
  1486. * @param handle [IN] Device handle
  1487. * @return Optimal packetsize
  1488. * @remarks To get optimized packet size, for GigEVision device is SCPS
  1489. 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.
  1490. This API is not supported by CameraLink device and U3V device.
  1491. This interface does not support GenTL devices (protocol not supported). If a network camera is added in GenTL mode, it is recommended to configure GevSCPSPacketSize according to the actual network situation,or 1500.
  1492. ************************************************************************/
  1493. MV_CAMCTRL_API int __stdcall MV_CC_GetOptimalPacketSize(IN void* handle);
  1494. /********************************************************************//**
  1495. * @~chinese
  1496. * @brief 设置是否打开重发包支持,及重发包设置
  1497. * @param handle [IN] 设备句柄
  1498. * @param bEnable [IN] 是否支持重发包
  1499. * @param nMaxResendPercent [IN] 最大重发比
  1500. * @param nResendTimeout [IN] 重发超时时间,范围:0-10000ms
  1501. * @return 成功,返回MV_OK;错误,返回错误码
  1502. * @remarks 连接设备之后调用该接口可以设置重发包属性,仅GigEVision设备支持。
  1503. * @~english
  1504. * @brief Set whethe to enable resend, and set resend
  1505. * @param handle [IN] Device handle
  1506. * @param bEnable [IN] enable resend
  1507. * @param nMaxResendPercent [IN] Max resend persent
  1508. * @param nResendTimeout [IN] Resend timeout, rang:0-10000ms
  1509. * @return Success, return MV_OK. Failure, return error code
  1510. * @remarks After the device is connected, call this interface to set resend packet properties, only supported by GigEVision camera.
  1511. ************************************************************************/
  1512. #ifndef __cplusplus
  1513. MV_CAMCTRL_API int __stdcall MV_GIGE_SetResend(IN void* handle, IN unsigned int bEnable, IN unsigned int nMaxResendPercent, IN unsigned int nResendTimeout);
  1514. #else
  1515. MV_CAMCTRL_API int __stdcall MV_GIGE_SetResend(IN void* handle, IN unsigned int bEnable, IN unsigned int nMaxResendPercent = 10, IN unsigned int nResendTimeout = 50);
  1516. #endif
  1517. /********************************************************************//**
  1518. * @~chinese
  1519. * @brief 设置重传命令最大尝试次数
  1520. * @param handle [IN] 设备句柄
  1521. * @param nRetryTimes [IN] 重传命令最大尝试次数,默认20
  1522. * @return 成功,返回MV_OK;错误,返回错误码
  1523. * @remarks 该接口必须在调用MV_GIGE_SetResend开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER
  1524. * @~english
  1525. * @brief set the max resend retry times
  1526. * @param handle [IN] Device handle
  1527. * @param nRetryTimes [IN] The max times to retry resending lost packets,default 20
  1528. * @return Success, return MV_OK. Failure, return error code
  1529. * @remarks This interface MUST be called after enabling resending lost packets by calling MV_GIGE_SetResend,
  1530. * otherwise would fail and return MV_E_CALLORDER.
  1531. ************************************************************************/
  1532. MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendMaxRetryTimes(IN void* handle, IN unsigned int nRetryTimes);
  1533. /********************************************************************//**
  1534. * @~chinese
  1535. * @brief 获取重传命令最大尝试次数
  1536. * @param handle [IN] 设备句柄
  1537. * @param pnRetryTimes [IN][OUT] 重传命令最大尝试次数
  1538. * @return 成功,返回MV_OK;错误,返回错误码
  1539. * @remarks 该接口必须在调用MV_GIGE_SetResend开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER
  1540. * @~english
  1541. * @brief get the max resend retry times
  1542. * @param handle [IN] Device handle
  1543. * @param pnRetryTimes [IN][OUT] The max times to retry resending lost packets
  1544. * @return Success, return MV_OK. Failure, return error code
  1545. * @remarks This interface MUST be called after enabling resending lost packets by calling MV_GIGE_SetResend,
  1546. * otherwise would fail and return MV_E_CALLORDER.
  1547. ************************************************************************/
  1548. MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendMaxRetryTimes(IN void* handle, IN OUT unsigned int* pnRetryTimes);
  1549. /********************************************************************//**
  1550. * @~chinese
  1551. * @brief 设置同一重传包多次请求之间的时间间隔
  1552. * @param handle [IN] 设备句柄
  1553. * @param nMillisec [IN] 同一重传包多次请求之间的时间间隔,默认10ms
  1554. * @return 成功,返回MV_OK;错误,返回错误码
  1555. * @remarks 该接口必须在调用MV_GIGE_SetResend开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER
  1556. * @~english
  1557. * @brief set time interval between same resend requests
  1558. * @param handle [IN] Device handle
  1559. * @param nMillisec [IN] The time interval between same resend requests,default 10ms
  1560. * @return Success, return MV_OK. Failure, return error code
  1561. * @remarks This interface MUST be called after enabling resending lost packets by calling MV_GIGE_SetResend,
  1562. * otherwise would fail and return MV_E_CALLORDER.
  1563. ************************************************************************/
  1564. MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendTimeInterval(IN void* handle, IN unsigned int nMillisec);
  1565. /********************************************************************//**
  1566. * @~chinese
  1567. * @brief 获取同一重传包多次请求之间的时间间隔
  1568. * @param handle [IN] 设备句柄
  1569. * @param pnMillisec [IN][OUT] 同一重传包多次请求之间的时间间隔
  1570. * @return 成功,返回MV_OK;错误,返回错误码
  1571. * @remarks 该接口必须在调用MV_GIGE_SetResend开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER
  1572. * @~english
  1573. * @brief get time interval between same resend requests
  1574. * @param handle [IN] Device handle
  1575. * @param pnMillisec [IN][OUT] The time interval between same resend requests
  1576. * @return Success, return MV_OK. Failure, return error code
  1577. * @remarks This interface MUST be called after enabling resending lost packets by calling MV_GIGE_SetResend,
  1578. * otherwise would fail and return MV_E_CALLORDER.
  1579. ************************************************************************/
  1580. MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendTimeInterval(IN void* handle, IN OUT unsigned int* pnMillisec);
  1581. /********************************************************************//**
  1582. * @~chinese
  1583. * @brief 设置传输模式,可以为单播模式、组播模式等
  1584. * @param handle [IN] 设备句柄
  1585. * @param stTransmissionType [IN] 传输模式结构体
  1586. * @return 成功,返回MV_OK;错误,返回错误码
  1587. * @remarks 通过该接口可以设置传输模式为单播、组播等模式,仅GigEVision设备支持。
  1588. * @~english
  1589. * @brief Set transmission type,Unicast or Multicast
  1590. * @param handle [IN] Device handle
  1591. * @param stTransmissionType [IN] Struct of transmission type
  1592. * @return Success, return MV_OK. Failure, return error code
  1593. * @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.
  1594. ************************************************************************/
  1595. MV_CAMCTRL_API int __stdcall MV_GIGE_SetTransmissionType(IN void* handle, IN MV_TRANSMISSION_TYPE * pstTransmissionType);
  1596. /********************************************************************//**
  1597. * @~chinese
  1598. * @brief 发出动作命令
  1599. * @param pstActionCmdInfo [IN] 动作命令信息
  1600. * @param pstActionCmdResults [IN][OUT] 动作命令返回信息列表
  1601. * @return 成功,返回MV_OK;错误,返回错误码
  1602. * @remarks 仅GigEVision设备支持。
  1603. * @~english
  1604. * @brief Issue Action Command
  1605. * @param pstActionCmdInfo [IN] Action Command
  1606. * @param pstActionCmdResults [IN][OUT] Action Command Result List
  1607. * @return Success, return MV_OK. Failure, return error code
  1608. * @remarks This API is supported only by GigEVision camera.
  1609. ************************************************************************/
  1610. MV_CAMCTRL_API int __stdcall MV_GIGE_IssueActionCommand(IN MV_ACTION_CMD_INFO* pstActionCmdInfo, IN OUT MV_ACTION_CMD_RESULT_LIST* pstActionCmdResults);
  1611. /********************************************************************//**
  1612. * @~chinese
  1613. * @brief 获取组播状态
  1614. * @param pstDevInfo [IN] 设备信息结构体
  1615. * @param pbStatus [IN][OUT] 组播状态,true:组播状态,false:非组播
  1616. * @return 成功,返回MV_OK;错误,返回错误码
  1617. * @remarks 该接口用于判断设备当前是否处于组播状态,解决客户端枚举时需要打开设备判断组播的问题。
  1618. 仅支持标准GigE Vision设备。
  1619. * @~english
  1620. * @brief Get Multicast Status
  1621. * @param pstDevInfo [IN] Device Information Structure
  1622. * @param pbStatus [IN][OUT] Status of Multicast
  1623. * @return Success, return MV_OK. Failure, return error code
  1624. * @remarks This interface is used to determine whether the camera is currently in multicast state,
  1625. and to solve the problem that the client needs to turn on the camera to determine multicast when enumerating.
  1626. This API only support GigE Vision Device.
  1627. ************************************************************************/
  1628. MV_CAMCTRL_API int __stdcall MV_GIGE_GetMulticastStatus(IN MV_CC_DEVICE_INFO* pstDevInfo, IN OUT bool* pbStatus);
  1629. /*******************Part8 ch: 仅CameraLink 设备支持的接口 | en: Only support camlink device interface*******************/
  1630. /********************************************************************//**
  1631. * @~chinese
  1632. * @brief 获取串口信息列表
  1633. * @param pstSerialPortList [IN][OUT] 串口信息列表
  1634. * @return 成功,返回MV_OK;错误,返回错误码
  1635. * @remarks 该接口用于获取本地的串口信息。该接口不支持arm和Linux32平台
  1636. * @~english
  1637. * @brief Get serial port information list
  1638. * @param pstSerialPortList [IN][OUT] serial port information list
  1639. * @return Success, return MV_OK. Failure, return error code
  1640. * @remarks This interface is used to get local serial port information. This API do not support arm and Linux32 platform.
  1641. ************************************************************************/
  1642. MV_CAMCTRL_API int __stdcall MV_CAML_GetSerialPortList(IN OUT MV_CAML_SERIAL_PORT_LIST* pstSerialPortList);
  1643. /********************************************************************//**
  1644. * @~chinese
  1645. * @brief 设置取指定枚举串口
  1646. * @param pstSerialPortList [IN][OUT] 串口信息列表
  1647. * @return 成功,返回MV_OK;错误,返回错误码
  1648. * @remarks 该接口用于设置枚举CameraLink 设备的指定串口。该接口不支持arm和Linux32平台
  1649. * @~english
  1650. * @brief Set the specified enumeration serial port
  1651. * @param pstSerialPortList [IN] serial port information list
  1652. * @return Success, return MV_OK. Failure, return error code
  1653. * @remarks This interface is used to set the specified enumeration serial port. This API do not support arm and Linux32 platform.
  1654. ************************************************************************/
  1655. MV_CAMCTRL_API int __stdcall MV_CAML_SetEnumSerialPorts(IN MV_CAML_SERIAL_PORT_LIST* pstSerialPortList);
  1656. /***********************************************************************************************************//**
  1657. * @~chinese
  1658. * @brief 设置设备波特率
  1659. * @param handle [IN] 设备句柄
  1660. * @param nBaudrate [IN] 设置的波特率值,数值参考CameraParams.h中宏定义,如#define MV_CAML_BAUDRATE_9600 0x00000001
  1661. * @return 成功,返回MV_OK,失败,返回错误码
  1662. * @remarks 该接口支持在设备未连接时调用. 通过GenTL协议访问设备时,需要先连接设备,才能调用该接口
  1663. 因硬件/系统/外部干扰等因素,配置高波特率可能导致通信异常,建议配置波特率最大小于115200
  1664. 该接口不支持arm和Linux32平台
  1665. * @~english
  1666. * @brief Set device baudrate using one of the CL_BAUDRATE_XXXX value
  1667. * @param handle [IN] Device handle
  1668. * @param nBaudrate [IN] baud rate to set. Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001
  1669. * @return Success, return MV_OK. Failure, return error code
  1670. * @remarks This API is supported only by CameraLink device.
  1671. This API support calls when devices are not connected. But it is necessary to connect to the device first when accessing a CameraLink Device through the GenTL protocol.
  1672. Due to hardware/system/external interference and other factors, configuring a high baud rate may cause abnormal communication.
  1673. It is recommended to configure a baud rate of less than 115200
  1674. This API do not support arm and Linux32 platform.
  1675. ************************************************************************************************************/
  1676. MV_CAMCTRL_API int __stdcall MV_CAML_SetDeviceBaudrate(IN void* handle, IN unsigned int nBaudrate);
  1677. /********************************************************************//**
  1678. * @~chinese
  1679. * @brief 获取设备波特率
  1680. * @param handle [IN] 设备句柄
  1681. * @param pnCurrentBaudrate [IN][OUT] 波特率信息指针,数值参考CameraParams.h中宏定义,如#define MV_CAML_BAUDRATE_9600 0x00000001
  1682. * @return 成功,返回MV_OK,失败,返回错误码
  1683. * @remarks 该接口支持在设备未连接时调用。该接口不支持arm和Linux32平台
  1684. * @~english
  1685. * @brief Returns the current device baudrate, using one of the CL_BAUDRATE_XXXX value
  1686. * @param handle [IN] Device handle
  1687. * @param pnCurrentBaudrate [IN][OUT] Return pointer of baud rate to user. Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001
  1688. * @return Success, return MV_OK. Failure, return error code
  1689. * @remarks This API is supported only by CameraLink device.
  1690. This API support calls when devices are not connected.
  1691. This API do not support arm and Linux32 platform.
  1692. ************************************************************************/
  1693. MV_CAMCTRL_API int __stdcall MV_CAML_GetDeviceBaudrate(IN void* handle,IN OUT unsigned int* pnCurrentBaudrate);
  1694. /********************************************************************//**
  1695. * @~chinese
  1696. * @brief 获取设备与主机间连接支持的波特率
  1697. * @param handle [IN] 设备句柄
  1698. * @param pnBaudrateAblity [IN][OUT] 支持的波特率信息的指针。所支持波特率的或运算结果,单个数值参考CameraParams.h中宏定义,如MV_CAML_BAUDRATE_9600 0x00000001
  1699. * @return 成功,返回MV_OK,失败,返回错误码
  1700. * @remarks 该接口支持在设备未连接时调用。该接口不支持arm和Linux32平台
  1701. * @~english
  1702. * @brief Returns supported baudrates of the combined device and host interface
  1703. * @param handle [IN] Device handle
  1704. * @param pnBaudrateAblity [IN][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
  1705. * @return Success, return MV_OK. Failure, return error code
  1706. * @remarks This API is supported only by CameraLink device.
  1707. This API support calls when devices are not connected.
  1708. This API do not support arm and Linux32 platform.
  1709. ************************************************************************/
  1710. MV_CAMCTRL_API int __stdcall MV_CAML_GetSupportBaudrates(IN void* handle,IN OUT unsigned int* pnBaudrateAblity);
  1711. /********************************************************************//**
  1712. * @~chinese
  1713. * @brief 设置串口操作等待时长
  1714. * @param handle [IN] 设备句柄
  1715. * @param nMillisec [IN] 串口操作的等待时长, 单位为ms
  1716. * @return 成功,返回MV_OK,失败,返回错误码
  1717. * @remarks 该接口不支持arm和Linux32平台
  1718. * @~english
  1719. * @brief Sets the timeout for operations on the serial port
  1720. * @param handle [IN] Device handle
  1721. * @param nMillisec [IN] Timeout in [ms] for operations on the serial port.
  1722. * @return Success, return MV_OK. Failure, return error code
  1723. * @remarks This API do not support arm and Linux32 platform.
  1724. ************************************************************************/
  1725. MV_CAMCTRL_API int __stdcall MV_CAML_SetGenCPTimeOut(IN void* handle, IN unsigned int nMillisec);
  1726. /*******************Part9 ch: 仅U3V设备支持的接口 | en: Only support U3V device interface*******************/
  1727. /********************************************************************//**
  1728. * @~chinese
  1729. * @brief 设置U3V的传输包大小
  1730. * @param handle [IN] 设备句柄
  1731. * @param nTransferSize [IN] 传输的包大小, Byte,默认为1M,rang:>=0x400,建议最大值:[windows] rang <= 0x400000;[Linux] rang <= 0x200000
  1732. * @return 成功,返回MV_OK,失败,返回错误码
  1733. * @remarks 增加传输包大小可以适当降低取流时的CPU占用率。但不同的PC和不同USB扩展卡存在不同的兼容性,如果该参数设置过大可能会出现取不到图像的风险。
  1734. * @~english
  1735. * @brief Set transfer size of U3V device
  1736. * @param handle [IN] Device handle
  1737. * @param nTransferSize [IN] Transfer size,Byte,default:1M,rang:>=0x400,Recommended maximum: [windows] rang <= 0x400000; [Linux] rang <= 0x200000
  1738. * @return Success, return MV_OK. Failure, return error code
  1739. * @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.
  1740. ************************************************************************/
  1741. MV_CAMCTRL_API int __stdcall MV_USB_SetTransferSize(IN void* handle, IN unsigned int nTransferSize);
  1742. /********************************************************************//**
  1743. * @~chinese
  1744. * @brief 获取U3V的传输包大小
  1745. * @param handle [IN] 设备句柄
  1746. * @param pnTransferSize [IN][OUT] 传输的包大小指针, Byte
  1747. * @return 成功,返回MV_OK,失败,返回错误码
  1748. * @remarks 该接口用于获取当前的U3V传输包大小,默认1M。
  1749. * @~english
  1750. * @brief Get transfer size of U3V device
  1751. * @param handle [IN] Device handle
  1752. * @param pnTransferSize [IN][OUT] Transfer size,Byte
  1753. * @return Success, return MV_OK. Failure, return error code
  1754. * @remarks This interface is used to get the current U3V transfer packet size, default 1M.
  1755. ************************************************************************/
  1756. MV_CAMCTRL_API int __stdcall MV_USB_GetTransferSize(IN void* handle, IN OUT unsigned int* pnTransferSize);
  1757. /********************************************************************//**
  1758. * @~chinese
  1759. * @brief 设置U3V的传输通道个数
  1760. * @param handle [IN] 设备句柄
  1761. * @param nTransferWays [IN] 传输通道个数,范围:1-10
  1762. * @return 成功,返回MV_OK,失败,返回错误码
  1763. * @remarks 用户可以根据PC的性能、设备出图帧率、图像大小和内存使用率等因素对该参数进行调节。但不同的PC和不同的USB扩展卡存在不同的兼容性。
  1764. * @~english
  1765. * @brief Set transfer ways of U3V device
  1766. * @param handle [IN] Device handle
  1767. * @param nTransferWays [IN] Transfer ways,rang:1-10
  1768. * @return Success, return MV_OK. Failure, return error code
  1769. * @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.
  1770. ************************************************************************/
  1771. MV_CAMCTRL_API int __stdcall MV_USB_SetTransferWays(IN void* handle, IN unsigned int nTransferWays);
  1772. /********************************************************************//**
  1773. * @~chinese
  1774. * @brief 获取U3V的传输通道个数
  1775. * @param handle [IN] 设备句柄
  1776. * @param pnTransferWays [IN][OUT] 传输通道个数指针
  1777. * @return 成功,返回MV_OK,失败,返回错误码
  1778. * @remarks 该接口用于获取当前的U3V异步取流节点个数,U口相机传输通道个数和像素格式对应的负载包大小相关,通过最大异步注册长度 / 像素格式对应的负载包大小 计算得出。
  1779. * @~english
  1780. * @brief Get transfer ways of U3V device
  1781. * @param handle [IN] Device handle
  1782. * @param pnTransferWays [IN][OUT] Transfer ways
  1783. * @return Success, return MV_OK. Failure, return error code
  1784. * @remarks This interface is used to get the current number of U3V asynchronous feed nodes.
  1785. For U3V camera, The number of transmission channels is related to the size of the payload size corresponding to the pixel format, which is calculated by the maximum asynchronous registration length / the payload size corresponding to pixel format.
  1786. ************************************************************************/
  1787. MV_CAMCTRL_API int __stdcall MV_USB_GetTransferWays(IN void* handle, IN OUT unsigned int* pnTransferWays);
  1788. /********************************************************************//**
  1789. * @~chinese
  1790. * @brief 注册流异常消息回调,在打开设备之后调用(只支持U3V相机,不支持GenTL设备)
  1791. * @param handle [IN] 设备句柄
  1792. * @param cbException [IN] 异常回调函数指针
  1793. * @param pUser [IN] 用户自定义变量
  1794. * @return 成功,返回MV_OK,失败,返回错误码
  1795. * @~english
  1796. * @brief Register exception stream callBack, call after open device (only support U3V Camera, don't support GenTL Device)
  1797. * @param handle [IN] Device handle
  1798. * @param cbException [IN] Exception callback function pointer
  1799. * @param pUser [IN] User defined variable
  1800. * @return Success, return MV_OK. Failure, return error code
  1801. ************************************************************************/
  1802. MV_CAMCTRL_API int __stdcall MV_USB_RegisterStreamExceptionCallBack(IN void* handle, IN void(__stdcall* cbException)(MV_CC_STREAM_EXCEPTION_TYPE enExceptionType, void* pUser), IN void* pUser);
  1803. /********************************************************************//**
  1804. * @~chinese
  1805. * @brief 设置U3V的事件缓存节点个数
  1806. * @param handle [IN] 设备句柄
  1807. * @param nEventNodeNum [IN] 事件缓存节点个数,范围:1-64
  1808. * @return 成功,返回MV_OK,失败,返回错误码
  1809. * @remarks 该接口用于设置当前的U3V事件缓存节点个数,默认情况下为5个。
  1810. * @~english
  1811. * @brief Set the number of U3V device event cache nodes
  1812. * @param handle [IN] Device handle
  1813. * @param nEventNodeNum [IN] Event Node Number
  1814. * @return Success, return MV_OK. Failure, return error code
  1815. * @remarks This interface is used to set the current number of U3V event nodes. default to 5 nodes.
  1816. ************************************************************************/
  1817. MV_CAMCTRL_API int __stdcall MV_USB_SetEventNodeNum(IN void* handle, IN unsigned int nEventNodeNum);
  1818. /********************************************************************//**
  1819. * @~chinese
  1820. * @brief 设置U3V的同步读写超时时间,范围为:[1000, UINT_MAX)
  1821. * @param handle [IN] 设备句柄
  1822. * @param nMills [IN] 设置同步读写超时时间,默认时间为1000ms
  1823. * @return 成功,返回MV_OK,失败,返回错误码
  1824. * @remarks 增加设置同步读取时间接口,兼容部分相机配置参数很慢,超过1000ms的情况
  1825. * @~english
  1826. * @brief Set U3V Synchronisation timeout,range:[1000, UINT_MAX)
  1827. * @param handle [IN] Device handle
  1828. * @param nMills [IN] set synchronisation timeout(ms),default 1000ms
  1829. * @return Success, return MV_OK. Failure, return error code
  1830. * @remarks Increasing the SetSyncTimeOut can compatible with some camera configuretion parameters very slow,more than 1000ms
  1831. ************************************************************************/
  1832. MV_CAMCTRL_API int __stdcall MV_USB_SetSyncTimeOut(IN void* handle, IN unsigned int nMills);
  1833. /********************************************************************//**
  1834. * @~chinese
  1835. * @brief 获取U3V相机同步读写超时时间
  1836. * @param handle [IN] 设备句柄
  1837. * @param pnMills [IN][OUT] 获取的超时时间(ms)
  1838. * @return 成功,返回MV_OK,失败,返回错误码
  1839. * @remarks 该接口用于获取当前的U3V同步读写超时时间大小,默认1000ms。
  1840. * @~english
  1841. * @brief Get U3V Camera Synchronisation timeout
  1842. * @param handle [IN] Device handle
  1843. * @param pnMills [IN][OUT] Get Synchronisation time(ms)
  1844. * @return Success, return MV_OK. Failure, return error code
  1845. * @remarks This interface is used to get the current U3V timeout, default 1000ms.
  1846. ************************************************************************/
  1847. MV_CAMCTRL_API int __stdcall MV_USB_GetSyncTimeOut(IN void* handle, IN OUT unsigned int* pnMills);
  1848. /*******************Part10 ch: GenTL相关接口 | en: GenTL related interface*******************/
  1849. /******************************************************************************//**
  1850. * @~chinese
  1851. * @brief 通过GenTL枚举Interfaces
  1852. * @param pstIFList [IN][OUT] Interfaces列表
  1853. * @param strGenTLPath [IN] GenTL的cti文件路径
  1854. * @return 成功,返回MV_OK;错误,返回错误码
  1855. * @remarks Interfaces列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请
  1856. 建议尽量避免多线程枚举操作。
  1857. 暂不支持工业相机SDK直接调用MvProducerU3V.cti和MvProducerGEV.cti, 支持调用其他.cti
  1858. * @~english
  1859. * @brief Enumerate Interfaces with GenTL
  1860. * @param pstIFList [IN][OUT] Interfaces List
  1861. * @param strGenTLPath [IN] GenTL cti file path
  1862. * @return Success, return MV_OK. Failure, return error code
  1863. * @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
  1864. It is recommended to avoid multithreaded enumeration operations as much as possible.
  1865. Currently not supported for SDK to directly call MvProducerU3V. cti and MvProducerGEV. cti. supports calling other. cti
  1866. *******************************************************************************/
  1867. MV_CAMCTRL_API int __stdcall MV_CC_EnumInterfacesByGenTL(IN OUT MV_GENTL_IF_INFO_LIST* pstIFList, IN const char * strGenTLPath);
  1868. /********************************************************************//**
  1869. * @~chinese
  1870. * @brief 卸载cti库
  1871. * @param pGenTLPath [IN] 枚举卡时加载的cti文件路径
  1872. * @return 成功,返回MV_OK;错误,返回错误码
  1873. * @remarks 卸载前需要保证通过该cti枚举出的相机已全部关闭,否则报错前置条件错误。
  1874. * @~english
  1875. * @brief Unload cti library
  1876. * @param pGenTLPath [IN] GenTL cti file path
  1877. * @return Success, return MV_OK. Failure, return error code
  1878. * @remarks Make sure that all devices enumerated by this cti are already closed.
  1879. ************************************************************************/
  1880. MV_CAMCTRL_API int __stdcall MV_CC_UnloadGenTLLibrary(IN const char * pGenTLPath);
  1881. /*****************************************************************************************************//**
  1882. * @~chinese
  1883. * @brief 通过GenTL Interface枚举设备
  1884. * @param pstIFInfo [IN] Interface信息
  1885. * @param pstDevList [IN][OUT] 设备列表
  1886. * @return 成功,返回MV_OK;错误,返回错误码
  1887. * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请
  1888. 建议尽量避免多线程枚举操作。
  1889. * @~english
  1890. * @brief Enumerate Devices with GenTL interface
  1891. * @param pstIFInfo [IN] Interface information
  1892. * @param pstDevList [IN][OUT] Device List
  1893. * @return Success, return MV_OK. Failure, return error code
  1894. * @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
  1895. It is recommended to avoid multithreaded enumeration operations as much as possible.
  1896. *****************************************************************************************************/
  1897. MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesByGenTL(IN MV_GENTL_IF_INFO* pstIFInfo, IN OUT MV_GENTL_DEV_INFO_LIST* pstDevList);
  1898. /********************************************************************//**
  1899. * @~chinese
  1900. * @brief 通过GenTL设备信息创建设备句柄
  1901. * @param handle [IN][OUT] 设备句柄
  1902. * @param pstDevInfo [IN] 设备信息结构体指针
  1903. * @return 成功,返回MV_OK;错误,返回错误码
  1904. * @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块。
  1905. * @~english
  1906. * @brief Create Device Handle with GenTL Device Info
  1907. * @param handle [IN][OUT] Device handle
  1908. * @param pstDevInfo [IN] Device Information
  1909. * @return Success, return MV_OK. Failure, return error code
  1910. * @remarks Create required resources within library and initialize internal module according to input device information.
  1911. ************************************************************************/
  1912. MV_CAMCTRL_API int __stdcall MV_CC_CreateHandleByGenTL(IN OUT void ** handle, IN const MV_GENTL_DEV_INFO* pstDevInfo);
  1913. /*******************Part11 ch: 图像保存、格式转换等相关接口 | en: Related image save and format convert interface*******************/
  1914. /********************************************************************//**
  1915. * @~chinese
  1916. * @brief 保存图片,支持Bmp和Jpeg.
  1917. * @param handle [IN] 设备句柄
  1918. * @param pstSaveParam [IN][OUT] 保存图片参数结构体
  1919. * @return 成功,返回MV_OK;错误,返回错误码
  1920. * @remarks 通过该接口可以将从设备采集到的原始图像数据转换成JPEG或者BMP等格式并存放在指定内存中,然后用户可以将转换之后的数据直接保存成图片文件。
  1921. 该接口调用无接口顺序要求,有图像源数据就可以进行转换,可以先调用MV_CC_GetOneFrameTimeout或者MV_CC_RegisterImageCallBackEx设置回调函数,获取一帧图像数据,然后再通过该接口转换格式。
  1922. 该接口支持图像 宽、高、总长最大至 UINT_MAX, 其中MV_CC_SaveImageEx2支持 宽、高、总长最大至 USHRT_MAX
  1923. JPEG格式最大支持宽高为65500
  1924. * @~english
  1925. * @brief Save image, support Bmp and Jpeg.
  1926. * @param handle [IN] Device handle
  1927. * @param pstSaveParam [IN][OUT] Save image parameters structure
  1928. * @return Success, return MV_OK. Failure, return error code
  1929. * @remarks Once there is image data, you can call this API to convert the data.
  1930. 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.
  1931. Comparing with the API MV_CC_SaveImageEx2, this API support the parameter nWidth/nHeight/nDataLen to UINT_MAX.
  1932. JPEG format supports a maximum width and height of 65500
  1933. ************************************************************************/
  1934. MV_CAMCTRL_API int __stdcall MV_CC_SaveImageEx3(IN void* handle, IN OUT MV_SAVE_IMAGE_PARAM_EX3* pstSaveParam);
  1935. /********************************************************************//**
  1936. * @~chinese
  1937. * @brief 保存图像到文件
  1938. * @param handle [IN] 设备句柄
  1939. * @param pstSaveFileParam [IN][OUT] 保存图片文件参数结构体
  1940. * @return 成功,返回MV_OK;错误,返回错误码
  1941. * @remarks 该接口支持BMP/JPEG/PNG/TIFF。
  1942. 该接口支持图像 宽、高、总长最大至 UINT_MAX
  1943. JPEG格式最大支持宽高为65500
  1944. * @~english
  1945. * @brief Save the image file.
  1946. * @param handle [IN] Device handle
  1947. * @param pstSaveFileParam [IN][OUT] Save the image file parameter structure
  1948. * @return Success, return MV_OK. Failure, return error code
  1949. * @remarks This API support BMP/JPEG/PNG/TIFF.
  1950. this API support the parameter nWidth/nHeight/nDataLen to UINT_MAX.
  1951. JPEG format supports a maximum width and height of 65500
  1952. ************************************************************************/
  1953. MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFileEx(IN void* handle, IN OUT MV_SAVE_IMAGE_TO_FILE_PARAM_EX* pstSaveFileParam);
  1954. /********************************************************************//**
  1955. * @~chinese
  1956. * @brief 保存图像到文件
  1957. * @param handle [IN] 设备句柄
  1958. * @param pstImage [IN] 图像信息
  1959. * @param pSaveImageParam [IN] 存图参数
  1960. * @param pcImagePath [IN] 存图路径
  1961. * @return 成功,返回MV_OK;错误,返回错误码
  1962. * @remarks 该接口支持4G以上超大图的PNG/TIFF存图,非超大图像支持BMP/JPEG/TIFF/PNG
  1963. JPEG格式最大支持宽高为65500
  1964. * @~english
  1965. * @brief Save the image file.
  1966. * @param handle [IN] Device handle
  1967. * @param pstImage [IN] Image information
  1968. * @param pSaveImageParam [IN] Save the image file parameter structure
  1969. * @param pcImagePath [IN] Image path
  1970. * @return Success, return MV_OK. Failure, return error code
  1971. * @remarks When the image size exceeds 4GB, only PNG and TIFF are supported. Otherwise, BMP,JPEG,TIFF and PNG are supported.
  1972. JPEG format supports a maximum width and height of 65500
  1973. ************************************************************************/
  1974. MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFileEx2(IN void* handle, IN MV_CC_IMAGE* pstImage, IN MV_CC_SAVE_IMAGE_PARAM* pSaveImageParam, IN const char* pcImagePath);
  1975. /********************************************************************//**
  1976. * @~chinese
  1977. * @brief 图像旋转
  1978. * @param handle [IN] 设备句柄
  1979. * @param pstRotateParam [IN][OUT] 图像旋转参数结构体
  1980. * @return 成功,返回MV_OK;错误,返回错误码
  1981. * @remarks 该接口只支持MONO8/RGB24/BGR24格式数据的90/180/270度旋转。
  1982. * @~english
  1983. * @brief Rotate Image
  1984. * @param handle [IN] Device handle
  1985. * @param pstRotateParam [IN][OUT] Rotate image parameter structure
  1986. * @return Success, return MV_OK. Failure, return error code
  1987. * @remarks This API only support 90/180/270 rotation of data in the MONO8/RGB24/BGR24 format.
  1988. ************************************************************************/
  1989. MV_CAMCTRL_API int __stdcall MV_CC_RotateImage(IN void* handle, IN OUT MV_CC_ROTATE_IMAGE_PARAM* pstRotateParam);
  1990. /********************************************************************//**
  1991. * @~chinese
  1992. * @brief 图像翻转
  1993. * @param handle [IN] 设备句柄
  1994. * @param pstFlipParam [IN][OUT] 图像翻转参数结构体
  1995. * @return 成功,返回MV_OK;错误,返回错误码
  1996. * @remarks 该接口只支持MONO8/RGB24/BGR24格式数据的垂直和水平翻转。
  1997. * @~english
  1998. * @brief Flip Image
  1999. * @param handle [IN] Device handle
  2000. * @param pstFlipParam [IN][OUT] Flip image parameter structure
  2001. * @return Success, return MV_OK. Failure, return error code
  2002. * @remarks This API only support vertical and horizontal reverse of data in the MONO8/RGB24/BGR24 format.
  2003. ************************************************************************/
  2004. MV_CAMCTRL_API int __stdcall MV_CC_FlipImage(IN void* handle, IN OUT MV_CC_FLIP_IMAGE_PARAM* pstFlipParam);
  2005. /********************************************************************//**
  2006. * @~chinese
  2007. * @brief 像素格式转换
  2008. * @param handle [IN] 设备句柄
  2009. * @param pstCvtParam [IN][OUT] 像素格式转换参数结构体
  2010. * @return 成功,返回MV_OK;错误,返回错误码
  2011. * @remarks 通过将接口可以将从设备采集到的原始图像数据转换成用户所需的像素格式并存放在指定内存中。
  2012. 该接口调用无接口顺序要求,有图像源数据就可以进行转换,可以先调用MV_CC_GetOneFrameTimeout或者MV_CC_RegisterImageCallBackEx设置回调函数,
  2013. 获取一帧图像数据,然后再通过该接口转换格式。如果设备当前采集图像是JPEG压缩的格式,则不支持调用该接口进行转换。
  2014. 该接口支持图像 宽、高、总长最大至 UINT_MAX, 其中MV_CC_ConvertPixelType支持 宽、高、总长最大至 USHRT_MAX
  2015. * @~english
  2016. * @brief Pixel format conversion
  2017. * @param handle [IN] Device handle
  2018. * @param pstCvtParam [IN][OUT] Convert Pixel Type parameter structure
  2019. * @return Success, return MV_OK. Failure, return error code
  2020. * @remarks This API is used to transform the collected original data to pixel format and save to specified memory.
  2021. There is no order requirement to call this API, the transformation will execute when there is image data.
  2022. First call MV_CC_GetOneFrameTimeout or MV_CC_RegisterImageCallBackEx to set callback function, and get a frame of image data,
  2023. then call this API to transform the format.
  2024. Comparing with the API MV_CC_ConvertPixelType, this API support the parameter nWidth/nHeight/nSrcDataLen to UINT_MAX.
  2025. ************************************************************************/
  2026. MV_CAMCTRL_API int __stdcall MV_CC_ConvertPixelTypeEx(IN void* handle, IN OUT MV_CC_PIXEL_CONVERT_PARAM_EX* pstCvtParam);
  2027. /********************************************************************//**
  2028. * @~chinese
  2029. * @brief 设置插值算法类型
  2030. * @param handle [IN] 设备句柄
  2031. * @param nBayerCvtQuality [IN] Bayer的插值方法 0-快速 1-均衡(默认为均衡) 2-最优 3-最优+
  2032. * @return 成功,返回MV_OK;错误,返回错误码
  2033. * @remarks 设置内部图像转换接口的Bayer插值算法类型参数,MV_CC_ConvertPixelTypeEx、MV_CC_GetImageForRGB/BGR接口内部使用的插值算法是该接口所设定的。
  2034. * @~english
  2035. * @brief Interpolation algorithm type setting
  2036. * @param handle [IN] Device handle
  2037. * @param nBayerCvtQuality [IN] Bayer interpolation method 0-Fast 1-Equilibrium 2-Optimal
  2038. * @return Success, return MV_OK. Failure, return error code
  2039. * @remarks Set the bell interpolation quality parameters of the internal image conversion interface,
  2040. and the interpolation algorithm used in the MV_CC_ConvertPixelTypeEx and MV_CC_GetImageForRGB/BGR interfaces is set by this interface.
  2041. ************************************************************************/
  2042. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCvtQuality(IN void* handle, IN unsigned int nBayerCvtQuality);
  2043. /********************************************************************//**
  2044. * @~chinese
  2045. * @brief 插值算法平滑使能设置
  2046. * @param handle [IN] 设备句柄
  2047. * @param bFilterEnable [IN] 平滑使能(默认关闭)
  2048. * @return 成功,返回#MV_OK;错误,返回错误码
  2049. * @remarks 设置内部图像转换接口的贝尔插值平滑使能参数,MV_CC_ConvertPixelTypeEx、MV_CC_SaveImageEx3接口内部使用的插值算法是该接口所设定的。
  2050. * @~english
  2051. * @brief Filter type of the bell interpolation quality algorithm setting
  2052. * @param handle [IN] Device handle
  2053. * @param bFilterEnable [IN] Filter type enable
  2054. * @return Success, return MV_OK. Failure, return error code
  2055. * @remarks Set the bell interpolation filter type parameters of the internal image conversion interface,
  2056. and the interpolation algorithm used in the MV_CC_ConvertPixelTypeEx and MV_CC_SaveImageEx3 interfaces is set by this interface.
  2057. ************************************************************************/
  2058. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerFilterEnable(IN void* handle, IN bool bFilterEnable);
  2059. /********************************************************************//**
  2060. * @~chinese
  2061. * @brief 设置Bayer格式的Gamma值
  2062. * @param handle [IN] 设备句柄
  2063. * @param fBayerGammaValue [IN] Gamma值:0.1 ~ 4.0
  2064. * @return 成功,返回MV_OK;错误,返回错误码
  2065. * @remarks 设置该值后,在调用MV_CC_ConvertPixelTypeEx、MV_CC_SaveImageEx3、MV_CC_SaveImageToFileEx接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时起效。
  2066. * @~english
  2067. * @brief Set Gamma value
  2068. * @param handle [IN] Device handle
  2069. * @param fBayerGammaValue [IN] Gamma value[0.1,4.0]
  2070. * @return Success, return MV_OK. Failure, return error code
  2071. * @remarks After setting the value, it works when calling MV_CC_ConvertPixelTypeEx\MV_CC_SaveImageEx3\MV_CC_SaveImageToFileEx API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64.
  2072. ************************************************************************/
  2073. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaValue(IN void* handle, IN float fBayerGammaValue);
  2074. /********************************************************************//**
  2075. * @~chinese
  2076. * @brief 设置Mono8/Bayer8/10/12/16格式的Gamma值
  2077. * @param handle [IN] 设备句柄
  2078. * @param MvGvspPixelType enSrcPixelType [IN] 像素格式,支持PixelType_Gvsp_Mono8,Bayer8/10/12/16
  2079. * @param fGammaValue [IN] Gamma值:0.1 ~ 4.0
  2080. * @return 成功,返回MV_OK;错误,返回错误码
  2081. * @remarks 设置Mono8的gamma值后,在调用MV_CC_ConvertPixelTypeEx接口将Mono8转成Mono8时gamma值起效。
  2082. * @remarks 设置Bayer8/10/12/16的gamma值后,在调用MV_CC_ConvertPixelTypeEx、MV_CC_SaveImageToFileEx、MV_CC_SaveImageEx3接口将Bayer8/10/12/16转RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时gamma值起效。
  2083. * @remarks 该接口兼容MV_CC_SetBayerGammaValue接口,新增支持Mono8像素格式
  2084. * @~english
  2085. * @brief Set Gamma value
  2086. * @param handle [IN] Device handle
  2087. * @param MvGvspPixelType enSrcPixelType [IN] PixelType,support PixelType_Gvsp_Mono8,Bayer8/10/12/16
  2088. * @param fGammaValue [IN] Gamma value:0.1~ 4.0
  2089. * @remarks After setting the gamma of Mono8 ,the gamma value takes effect when calling MV_CC_ConvertPixelTypeEx converts Mono8 to Mono8.
  2090. * @remarks After setting the gamma of Bayer8/10/12/16, the gamma value takes effect when calling MV_CC_ConvertPixelTypeEx\MV_CC_SaveImageToFileEx\MV_CC_SaveImageEx3 converts Bayer8/10/12/16 to RGB24/48,RGBA32/64,BGR24/48,BGRA32/64.
  2091. * @remarks This API compatible with MV_CC_SetBayerGammaValue, adds Mono8 PixelType.
  2092. * @return Success, return MV_OK. Failure, return error code
  2093. ************************************************************************/
  2094. MV_CAMCTRL_API int __stdcall MV_CC_SetGammaValue(IN void* handle, IN enum MvGvspPixelType enSrcPixelType, IN float fGammaValue);
  2095. /********************************************************************//**
  2096. * @~chinese
  2097. * @brief 设置Bayer格式的Gamma信息
  2098. * @param handle [IN] 设备句柄
  2099. * @param pstGammaParam [IN] Gamma信息
  2100. * @return 成功,返回MV_OK;错误,返回错误码
  2101. * @remarks 设置该信息后,在调用MV_CC_ConvertPixelTypeEx、MV_CC_SaveImageEx3、MV_CC_SaveImageToFileEx接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时Gamma值起效。
  2102. * @~english
  2103. * @brief Set Gamma param
  2104. * @param handle [IN] Device handle
  2105. * @param pstGammaParam [IN] Gamma param
  2106. * @return Success, return MV_OK. Failure, return error code
  2107. * @remarks After setting the param, it work in the calling MV_CC_ConvertPixelTypeEx\MV_CC_SaveImageEx3\MV_CC_SaveImageToFileEx API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64.
  2108. ************************************************************************/
  2109. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaParam(IN void* handle, IN MV_CC_GAMMA_PARAM* pstGammaParam);
  2110. /********************************************************************//**
  2111. * @~chinese
  2112. * @brief 设置Bayer格式的CCM使能和矩阵,量化系数默认1024
  2113. * @param handle [IN] 设备句柄
  2114. * @param pstCCMParam [IN] CCM参数
  2115. * @return 成功,返回MV_OK;错误,返回错误码
  2116. * @remarks 开启CCM并设置CCM矩阵后,在调用MV_CC_ConvertPixelTypeEx、MV_CC_SaveImageEx3接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时起效。
  2117. * @~english
  2118. * @brief Set CCM param,Scale default 1024
  2119. * @param handle [IN] Device handle
  2120. * @param pstCCMParam [IN] CCM parameter structure
  2121. * @return Success, return MV_OK. Failure, return error code
  2122. * @remarks After enable the color correction and set the color correction matrix, It work in the calling MV_CC_ConvertPixelTypeEx\MV_CC_SaveImageEx3 API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64.
  2123. ************************************************************************/
  2124. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParam(IN void* handle, IN MV_CC_CCM_PARAM* pstCCMParam);
  2125. /********************************************************************//**
  2126. * @~chinese
  2127. * @brief 设置Bayer格式的CCM使能和矩阵
  2128. * @param handle [IN] 设备句柄
  2129. * @param pstCCMParam [IN] CCM参数
  2130. * @return 成功,返回MV_OK;错误,返回错误码
  2131. * @remarks 开启CCM并设置CCM矩阵后,在调用MV_CC_ConvertPixelTypeEx、MV_CC_SaveImageEx3接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时起效。
  2132. * @~english
  2133. * @brief Set CCM param
  2134. * @param handle [IN] Device handle
  2135. * @param pstCCMParam [IN] CCM parameter structure
  2136. * @return Success, return MV_OK. Failure, return error code
  2137. * @remarks After enable the color correction and set the color correction matrix, It work in the calling MV_CC_ConvertPixelTypeEx\MV_CC_SaveImageEx3 API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64.
  2138. ************************************************************************/
  2139. MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParamEx(IN void* handle, IN MV_CC_CCM_PARAM_EX* pstCCMParam);
  2140. /********************************************************************//**
  2141. * @~chinese
  2142. * @brief 图像对比度调节
  2143. * @param handle [IN] 设备句柄
  2144. * @param pstContrastParam [IN][OUT] 对比度调节参数
  2145. * @return 成功,返回MV_OK;错误,返回错误码
  2146. * @remarks
  2147. * @~english
  2148. * @brief Adjust image contrast
  2149. * @param handle [IN] Device handle
  2150. * @param pstContrastParam [IN][OUT] Contrast parameter structure
  2151. * @return Success, return MV_OK. Failure, return error code
  2152. * @remarks
  2153. ************************************************************************/
  2154. MV_CAMCTRL_API int __stdcall MV_CC_ImageContrast(IN void* handle, IN OUT MV_CC_CONTRAST_PARAM* pstContrastParam);
  2155. /********************************************************************//**
  2156. * @~chinese
  2157. * @brief 图像去紫边
  2158. * @param handle [IN] 设备句柄
  2159. * @param pstPurpleFringingParam [IN][OUT] 去紫边参数
  2160. * @return 成功,返回MV_OK;错误,返回错误码
  2161. * @remarks 像素格式仅支持PixelType_Gvsp_RGB8_Packed和PixelType_Gvsp_BGR8_Packed
  2162. * @~english
  2163. * @brief Remove the purple edge from the image.
  2164. * @param handle [IN] Device handle
  2165. * @param pstPurpleFringingParam [IN][OUT] PurpleFringing parameter structure
  2166. * @return Success, return MV_OK. Failure, return error code
  2167. * @remarks Only supports PixelType_Gvsp_RGB8_Packed and PixelType_Gvsp_BGR8_Packed.
  2168. * ************************************************************************/
  2169. MV_CAMCTRL_API int __stdcall MV_CC_PurpleFringing(IN void* handle, IN MV_CC_PURPLE_FRINGING_PARAM* pstPurpleFringingParam);
  2170. /********************************************************************//**
  2171. * @~chinese
  2172. * @brief 无损解码
  2173. * @param handle [IN] 设备句柄
  2174. * @param pstDecodeParam [IN][OUT] 无损解码参数结构体
  2175. * @return 成功,返回MV_OK;错误,返回错误码
  2176. * @remarks 将从相机中取到的无损压缩码流解码成裸数据,同时支持解析当前相机实时图像的水印信息(如果输入的无损码流不是当前相机或者不是实时取流的,则水印解析可能异常);
  2177. 若解码失败,请检查以下情况:(1)需要CPU支持 SSE AVX指令集(2)若当前帧异常(丢包等),可能导致解码异常(3)相机出图异常, 即使不丢包也会异常
  2178. * @~english
  2179. * @brief High Bandwidth Decode
  2180. * @param handle [IN] Device handle
  2181. * @param pstDecodeParam [IN][OUT] High Bandwidth Decode parameter structure
  2182. * @return Success, return MV_OK. Failure, return error code
  2183. * @remarks Decode the lossless compressed data from the camera into raw data,At the same time, it supports parsing the watermark information of the real-time image of the current camera (if the input lossless code stream is not the current camera or is not real-time streaming, the watermark parsing may be abnormal);
  2184. If decoding fails, please check the following: (1) The CPU is required to support the SSE AVX instruction set. (2) If the current frame is abnormal (packet loss, etc.), it may cause decoding exceptions. (3) The camera plot is abnormal, even if there is no packet loss, it may cause exceptions
  2185. ************************************************************************/
  2186. MV_CAMCTRL_API int __stdcall MV_CC_HB_Decode(IN void* handle, IN OUT MV_CC_HB_DECODE_PARAM* pstDecodeParam);
  2187. /********************************************************************//**
  2188. * @~chinese
  2189. * @brief 在图像上绘制矩形框辅助线
  2190. * @param handle [IN] 设备句柄
  2191. * @param pRectInfo [IN] 矩形辅助线的信息
  2192. * @return 成功,返回MV_OK;错误,返回错误码
  2193. * @remarks 该接口仅支持windows平台
  2194. * @~english
  2195. * @brief Draw Rect Auxiliary Line
  2196. * @param handle [IN] Device handle
  2197. * @param pRectInfo [IN] Rect Auxiliary Line Info
  2198. * @return Success, return MV_OK. Failure, return error code
  2199. * @remarks This interface only supports windows platform.
  2200. ***********************************************************************/
  2201. MV_CAMCTRL_API int __stdcall MV_CC_DrawRect(IN void* handle, IN MVCC_RECT_INFO* pRectInfo);
  2202. /********************************************************************//**
  2203. * @~chinese
  2204. * @brief 在图像上绘制圆形辅助线
  2205. * @param handle [IN] 设备句柄
  2206. * @param pCircleInfo [IN] 圆形辅助线的信息
  2207. * @return 成功,返回MV_OK;错误,返回错误码
  2208. * @remarks 该接口仅支持windows平台
  2209. * @~english
  2210. * @brief Draw Circle Auxiliary Line
  2211. * @param handle [IN] Device Handle
  2212. * @param pCircleInfo [IN] Circle Auxiliary Line Info
  2213. * @return Success, return MV_OK. Failure, return error code
  2214. * @remarks This interface only supports windows platform.
  2215. ***********************************************************************/
  2216. MV_CAMCTRL_API int __stdcall MV_CC_DrawCircle(IN void* handle, IN MVCC_CIRCLE_INFO* pCircleInfo);
  2217. /********************************************************************//**
  2218. * @~chinese
  2219. * @brief 在图像上绘制线条
  2220. * @param handle [IN] 设备句柄
  2221. * @param pLinesInfo [IN] 线条辅助线信息
  2222. * @return 成功,返回MV_OK;错误,返回错误码
  2223. * @remarks 该接口仅支持windows平台
  2224. * @~english
  2225. * @brief Draw Line Auxiliary Line
  2226. * @param handle [IN] Device Handle
  2227. * @param pLinesInfo [IN] Linear Auxiliary Line Info
  2228. * @return Success, return MV_OK. Failure, return error code
  2229. * @remarks This interface only supports windows platform.
  2230. ***********************************************************************/
  2231. MV_CAMCTRL_API int __stdcall MV_CC_DrawLines(IN void* handle, IN MVCC_LINES_INFO* pLinesInfo);
  2232. /********************************************************************//**
  2233. * @~chinese
  2234. * @brief 开始录像
  2235. * @param handle [IN] 设备句柄
  2236. * @param pstRecordParam [IN] 录像参数结构体
  2237. * @return 成功,返回MV_OK;错误,返回错误码
  2238. 该接口最大支持Width*Height为8000*8000大小,否则会导致调用MV_CC_InputOneFrame接口错误。
  2239. * @~english
  2240. * @brief Start Record
  2241. * @param handle [IN] Device handle
  2242. * @param pstRecordParam [IN] Record param structure
  2243. * @return Success, return MV_OK. Failure, return error code
  2244. The maximum supported width * height of this interface is 8000 * 8000, otherwise it will result in calling MV_ CC_ InputOneFrame interface error.
  2245. ************************************************************************/
  2246. MV_CAMCTRL_API int __stdcall MV_CC_StartRecord(IN void* handle, IN MV_CC_RECORD_PARAM* pstRecordParam);
  2247. /********************************************************************//**
  2248. * @~chinese
  2249. * @brief 输入录像数据
  2250. * @param handle [IN] 设备句柄
  2251. * @param pstInputFrameInfo [IN] 录像数据结构体
  2252. * @return 成功,返回MV_OK;错误,返回错误码
  2253. * @~english
  2254. * @brief Input RAW data to Record
  2255. * @param handle [IN] Device handle
  2256. * @param pstInputFrameInfo [IN] Record data structure
  2257. * @return Success, return MV_OK. Failure, return error code
  2258. ************************************************************************/
  2259. MV_CAMCTRL_API int __stdcall MV_CC_InputOneFrame(IN void* handle, IN MV_CC_INPUT_FRAME_INFO * pstInputFrameInfo);
  2260. /********************************************************************//**
  2261. * @~chinese
  2262. * @brief 停止录像
  2263. * @param handle [IN] 设备句柄
  2264. * @return 成功,返回MV_OK;错误,返回错误码
  2265. * @~english
  2266. * @brief Stop Record
  2267. * @param handle [IN] Device handle
  2268. * @return Success, return MV_OK. Failure, return error code
  2269. ************************************************************************/
  2270. MV_CAMCTRL_API int __stdcall MV_CC_StopRecord(IN void* handle);
  2271. /********************************************************************//**
  2272. * @~chinese
  2273. * @brief 重构图像(用于分时曝光功能)
  2274. * @param handle [IN] 设备句柄
  2275. * @param pstReconstructParam [IN][OUT] 重构图像参数
  2276. * @return 成功,返回MV_OK,失败,返回错误码。
  2277. * @remarks 图像分割支持任意像素格式,图像分割应与线阵相机的“MultiLightControl”节点搭配使用,该节点可设置多个不同的曝光值,如MultiLightControl=2,
  2278. 相机会将两个不同曝光值所对应的两张图像交叠合并为一张图像(实际高度为两张图像的高度)发送给上层应用程序,
  2279. 调用该接口并传入分时曝光值nExposureNum为2,可将相机发送的一张图像分割为2张图像,这两张图像分别对应一个曝光值。
  2280. 若使用普通相机或未打开线阵相机的“MultiLightControl”节点,则图像分割无意义,只是将图像按行分割为2,3,4张图像,
  2281. 每张图像的高度变为原图像的1/2,1/3,1/4(由nExposureNum决定)。
  2282. * @~english
  2283. * @brief Reconstruct Image(For time-division exposure function)
  2284. * @param handle [IN] Device handle
  2285. * @param pstReconstructParam [IN][OUT] Reconstruct image parameters
  2286. * @return Success, return MV_OK, Failure, return error code.
  2287. * @remarks Image segmentation supports any pixel format. Image segmentation should be used with the "MultiLightControl" node of the linear array camera. This node can set multiple different exposure values, such as MultiLightControl=2,
  2288. The camera will overlap and merge two images corresponding to two different exposure values into one image (the actual height is the height of the two images) and send it to the upper application.
  2289. Call the interface and pass in nExposureNum is two. One image sent by the camera can be divided into two images, each of which corresponds to an exposure value.
  2290. If an ordinary camera is used or the "MultiLightControl" node of the linear array camera is not turned on, the image segmentation is meaningless, but the image is divided into 2, 3, and 4 images by line.
  2291. The height of each image becomes 1/2, 1/3, 1/4 of the original image (determined by nExposureNum).
  2292. ************************************************************************/
  2293. MV_CAMCTRL_API int __stdcall MV_CC_ReconstructImage(IN void* handle, IN OUT MV_RECONSTRUCT_IMAGE_PARAM* pstReconstructParam);
  2294. /********************************************************************//**
  2295. * @~chinese
  2296. * @brief 分配对齐内存
  2297. * @param nBufLen [IN] 分配内存的长度
  2298. * @param nAlignment [IN] 内存对齐字节数 (必须是大于0,并且是2的整数次幂)
  2299. * @return 成功,返回申请内存地址,失败,返回 NULL
  2300. * @remarks
  2301. * @~english
  2302. * @brief
  2303. * @param nBufLen [IN] memory bytes
  2304. * @param nAlignment [IN] memory aligned bytes (Must be an integer power of 2 greater than 0)
  2305. * @return Success, return memory address, Failure, return NULL.
  2306. * @remarks
  2307. ************************************************************************/
  2308. MV_CAMCTRL_API void * __stdcall MV_CC_AllocAlignedBuffer(IN uint64_t nBufSize, IN unsigned int nAlignment);
  2309. /********************************************************************//**
  2310. * @~chinese
  2311. * @brief 对齐内存释放
  2312. * @param pBuffer [IN] 内存地址
  2313. * @return 成功,返回MV_OK,失败,返回错误码。
  2314. * @remarks 对齐内存的释放,搭配MV_CC_AllocAlignedBuffer使用
  2315. * @~english
  2316. * @brief release aligned memory
  2317. * @param pBuffer [IN] memory address
  2318. * @return Success, return MV_OK, Failure, return error code.
  2319. * @remarks
  2320. ************************************************************************/
  2321. MV_CAMCTRL_API int __stdcall MV_CC_FreeAlignedBuffer(IN void* pBuffer);
  2322. /********************************************************************//**
  2323. * @~chinese
  2324. * @brief 获取设备palyload大小(payload包含图像数据和Chunk数据)和内存对其方式,用于SDK外部注册缓存时,应用层分配足够的缓存及正确的内存对齐方式
  2325. * @param handle [IN] 设备句柄
  2326. * @param pnPayloadSize [IN OUT] 负载长度
  2327. * @param pnAlignment [IN OUT] 负载内存对齐的字节数
  2328. * @return 成功,返回MV_OK,失败,返回错误码。
  2329. * @remarks
  2330. * @~english
  2331. * @brief Obtain the device payload size (payload includes image data and Chunk data) and memory alignment method,
  2332. which is used by the application layer to allocate sufficient cache and correct memory alignment when registering external cache for SDK
  2333. * @param handle [IN] Device Handle
  2334. * @param pnPayloadSize [IN OUT] Payload size
  2335. * @param pnAlignment [IN OUT] Alignment bytes
  2336. * @return Success, return MV_OK, Failure, return error code.
  2337. * @remarks
  2338. ************************************************************************/
  2339. MV_CAMCTRL_API int __stdcall MV_CC_GetPayloadSize(IN void* handle, IN OUT uint64_t* pnPayloadSize, IN OUT unsigned int* pnAlignment);
  2340. /********************************************************************//**
  2341. * @~chinese
  2342. * @brief 应用程序分配缓存,并注册到SDK内部,供SDK使用
  2343. * @param handle [IN] 设备句柄
  2344. * @param pBuffer [IN] 内存地址
  2345. * @param nBufSize [IN] 内存长度
  2346. * @param pUser [IN] 用户指针
  2347. * @return 成功,返回MV_OK,失败,返回错误码。
  2348. * @remarks 可以使用 MV_CC_GetPayloadSize 获取缓存大小,并使用 MV_CC_AllocAlignedBuffer 分配空间,之后进行MV_CC_RegisterBuffer注册
  2349. 注册的缓存需要由应用层通知SDK取消注册(MV_CC_UnRegisterBuffer)后,进行释放(MV_CC_FreeAlignedBuffer)
  2350. 使用该接口后,仅仅支持MV_CC_GetImageBuffer/MV_CC_FreeImageBuffer MV_CC_RegisterImageCallBackEx 获取图像,不支持其他接口获取图像
  2351. 使用该接口后,如果之前配置了SDK内部节点(MV_CC_SetImageNodeNum)无效
  2352. 双USB接口相机要求至少注册3块空间到SDK内部;其他相机暂无限制,但是为了避免缓存不足,请配置足够的缓存到底层
  2353. * @~english
  2354. * @brief The application allocates memory and registers it within the SDK for use by the SDK
  2355. * @param handle [IN] Device Handle
  2356. * @param pBuffer [IN] external memory address
  2357. * @param nBufSize [IN] external memory len
  2358. * @param pUser [IN] User Pointer
  2359. * @return Success, return MV_OK, Failure, return error code.
  2360. * @remarks Registering memory can be done by using MV_CC_GetPayloadSize to obtain the memory size, and allocating the memory size using MV_CC_AllocAlignedBuffer
  2361. The registered memory needs to be notified by the application layer to the SDK to cancel the registration (MV_CC_UnregisterBuffer) and then released (MV_CC_FreeAlignedBuffer)
  2362. After using this interface, only MV_CC_GetImageBuffer、MV_CC_FreeImageBuffer/MV_CC_RegisterImageCallBackEx is supported for image retrieval, and other interfaces are not supported for image retrieval
  2363. After using this interface, if the SDK internal node (MV_CC_SetImageNodeNum) was previously configured, it is invalid
  2364. The dual USB interface camera requires at least 3 spaces to be registered inside the SDK;There is no limit for other cameras for the time being, but to avoid insufficient cache, please configure sufficient cache into the SDK
  2365. ************************************************************************/
  2366. MV_CAMCTRL_API int __stdcall MV_CC_RegisterBuffer(IN void* handle, IN void *pBuffer, IN uint64_t nBufSize, IN void* pUser);
  2367. /********************************************************************//**
  2368. * @~chinese
  2369. * @brief 外部内存取消SDK内部注册
  2370. * @param handle [IN] 设备句柄
  2371. * @param pBuffer [IN] 外部内存地址
  2372. * @return 成功,返回MV_OK,失败,返回错误码。
  2373. * @remarks
  2374. * @~english
  2375. * @brief revoke external memory
  2376. * @param handle [IN] Device Handle
  2377. * @param pBuffer [IN] external memory address
  2378. * @return Success, return MV_OK, Failure, return error code.
  2379. * @remarks
  2380. ************************************************************************/
  2381. MV_CAMCTRL_API int __stdcall MV_CC_UnRegisterBuffer(IN void* handle, IN void* pBuffer);
  2382. #ifdef __cplusplus
  2383. }
  2384. #endif
  2385. #endif //_MV_CAMERA_CTRL_H_