MvCameraControl.h 212 KB

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