-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMvCameraControl.h
2129 lines (1891 loc) · 136 KB
/
MvCameraControl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef _MV_CAMERA_CTRL_H_
#define _MV_CAMERA_CTRL_H_
#include "MvErrorDefine.h"
#include "CameraParams.h"
#include "MvObsoleteInterfaces.h"
/************************************************************************/
/* 动态库导入导出定义 */
/* Import and export definition of the dynamic library */
/************************************************************************/
#ifndef MV_CAMCTRL_API
#if (defined (_WIN32) || defined(WIN64))
#if defined(MV_CAMCTRL_EXPORTS)
#define MV_CAMCTRL_API __declspec(dllexport)
#else
#define MV_CAMCTRL_API __declspec(dllimport)
#endif
#else
#ifndef __stdcall
#define __stdcall
#endif
#ifndef MV_CAMCTRL_API
#define MV_CAMCTRL_API
#endif
#endif
#endif
#ifndef IN
#define IN
#endif
#ifndef OUT
#define OUT
#endif
#ifdef __cplusplus
extern "C" {
#endif
/************************************************************************/
/* 设备的基本指令和操作 */
/* Camera basic instructions and operations */
/************************************************************************/
/********************************************************************//**
* @~chinese
* @brief 获取SDK版本号
* @return 返回4字节版本号
|主 |次 |修正 | 测试|
8bits 8bits 8bits 8bits
* @remarks 比如返回值为0x01000001,即SDK版本号为V1.0.0.1。
* @~english
* @brief Get SDK Version
* @return Always return 4 Bytes of version number
|Main |Sub |Rev | Test|
8bits 8bits 8bits 8bits
* @remarks For example, if the return value is 0x01000001, the SDK version is V1.0.0.1.
************************************************************************/
MV_CAMCTRL_API unsigned int __stdcall MV_CC_GetSDKVersion();
/********************************************************************//**
* @~chinese
* @brief 获取支持的传输层
* @return 支持的传输层编号
* @~english
* @brief Get supported Transport Layer
* @return Supported Transport Layer number
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_EnumerateTls();
/********************************************************************//**
* @~chinese
* @brief 枚举设备
* @param nTLayerType [IN] 枚举传输层
* @param pstDevList [OUT] 设备列表
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,\n
建议尽量避免多线程枚举操作。
* @~english
* @brief Enumerate Device
* @param nTLayerType [IN] Enumerate TLs
* @param pstDevList [OUT] Device List
* @return Success, return MV_OK. Failure, return error code
* @remarks The memory of the device list is allocated within the SDK. When the interface is invoked by multiple threads, the memory of the device list will be released and applied.\n
It is recommended to avoid multithreaded enumeration operations as much as possible.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_EnumDevices(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList);
/********************************************************************//**
* @~chinese
* @brief 根据厂商名字枚举设备
* @param nTLayerType [IN] 枚举传输层
* @param pstDevList [OUT] 设备列表
* @param strManufacturerName [IN] 厂商名字
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,\n
建议尽量避免多线程枚举操作。
* @~english
* @brief Enumerate device according to manufacture name
* @param nTLayerType [IN] Transmission layer of enumeration
* @param pstDevList [OUT] Device list
* @param strManufacturerName [IN] Manufacture Name
* @return Success, return MV_OK. Failure, return error code
* @remarks The memory of the device list is allocated within the SDK. When the interface is invoked by multiple threads, the memory of the device list will be released and applied.\n
It is recommended to avoid multithreaded enumeration operations as much as possible.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesEx(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList, IN const char* strManufacturerName);
/********************************************************************//**
* @~chinese
* @brief 设备是否可达
* @param pstDevInfo [IN] 设备信息结构体
* @param nAccessMode [IN] 访问权限
* @return 可达,返回true;不可达,返回false
* @remarks 读取设备CCP寄存器的值,判断当前状态是否具有某种访问权限。 \n
如果设备不支持MV_ACCESS_ExclusiveWithSwitch、MV_ACCESS_ControlWithSwitch、MV_ACCESS_ControlSwitchEnableWithKey这三种模式,接口返回false。目前设备不支持这3种抢占模式,国际上主流的厂商的设备也都暂不支持这3种模式。 \n
该接口不支持CameraLink设备。
* @~english
* @brief Is the device accessible
* @param pstDevInfo [IN] Device Information Structure
* @param nAccessMode [IN] Access Right
* @return Access, return true. Not access, return false
* @remarks Read device CCP register value and determine current access permission.\n
Return false if the device does not support the modes MV_ACCESS_ExclusiveWithSwitch, MV_ACCESS_ControlWithSwitch, MV_ACCESS_ControlSwitchEnableWithKey. Currently the device does not support the 3 preemption modes, neither do the devices from other mainstream manufacturers. \n
This API is not supported by CameraLink device.
************************************************************************/
MV_CAMCTRL_API bool __stdcall MV_CC_IsDeviceAccessible(IN MV_CC_DEVICE_INFO* pstDevInfo, IN unsigned int nAccessMode);
/********************************************************************//**
* @~chinese
* @brief 设置SDK日志路径
* @param strSDKLogPath [IN] SDK日志路径
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 设置路径之后,可以指定路径存放日志。\n
v2.4.1版本新增日志服务,开启服务之后该接口无效,默认日志服务为开启状态。
* @~english
* @brief Set SDK log path
* @param strSDKLogPath [IN] SDK log path
* @return Access, return true. Not access, return false
* @remarks For version V2.4.1, afFileed log service, this API is invalid when the service is enabled.And The logging service is enabled by default\n
This API is used to set the log file storing path.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetSDKLogPath(IN const char * strSDKLogPath);
/********************************************************************//**
* @~chinese
* @brief 创建设备句柄
* @param handle [OUT] 设备句柄
* @param pstDevInfo [IN] 设备信息结构体
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块。通过该接口创建句柄,调用SDK接口,会默认生成SDK日志文件,如果不需要生成日志文件,可以通过MV_CC_CreateHandleWithoutLog创建句柄。
* @~english
* @brief Create Device Handle
* @param handle [OUT] Device handle
* @param pstDevInfo [IN] Device Information Structure
* @return Success, return MV_OK. Failure, return error code
* @remarks Create required resources within library and initialize internal module according to input device information. Create handle and call SDK interface through this interface, and SDK log file will be created by default. Creating handle through MV_CC_CreateHandleWithoutLog will not generate log files.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_CreateHandle(OUT void ** handle, IN const MV_CC_DEVICE_INFO* pstDevInfo);
/********************************************************************//**
* @~chinese
* @brief 创建设备句柄,不生成日志
* @param handle [OUT] 设备句柄
* @param pstDevInfo [IN] 设备信息结构体
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块。通过该接口创建句柄,调用SDK接口,不会默认生成SDK日志文件,如果需要生成日志文件可以通过MV_CC_CreateHandle创建句柄,日志文件自动生成。
* @~english
* @brief Create Device Handle without log
* @param handle [OUT] Device handle
* @param pstDevInfo [IN] Device Information Structure
* @return Success, return MV_OK. Failure, return error code
* @remarks Create required resources within library and initialize internal module according to input device information. Create handle and call SDK interface through this interface, and SDK log file will not be created. To create logs, create handle through MV_CC_CreateHandle, and log files will be automatically generated.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_CreateHandleWithoutLog(OUT void ** handle, IN const MV_CC_DEVICE_INFO* pstDevInfo);
/********************************************************************//**
* @~chinese
* @brief 销毁设备句柄
* @param handle [IN] 设备句柄
* @return 成功,返回MV_OK;错误,返回错误码
* @~english
* @brief Destroy Device Handle
* @param handle [IN] Device handle
* @return Success, return MV_OK. Failure, return error code
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_DestroyHandle(IN void * handle);
/********************************************************************//**
* @~chinese
* @brief 打开设备
* @param handle [IN] 设备句柄
* @param nAccessMode [IN] 访问权限
* @param nSwitchoverKey [IN] 切换访问权限时的密钥
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 根据设置的设备参数,找到对应的设备,连接设备。\n
调用接口时可不传入nAccessMode和nSwitchoverKey,此时默认设备访问模式为独占权限。目前设备暂不支持MV_ACCESS_ExclusiveWithSwitch、MV_ACCESS_ControlWithSwitch、MV_ACCESS_ControlSwitchEnable、MV_ACCESS_ControlSwitchEnableWithKey这四种抢占模式。\n
对于U3V设备,nAccessMode、nSwitchoverKey这两个参数无效。
* @~english
* @brief Open Device
* @param handle [IN] Device handle
* @param nAccessMode [IN] Access Right
* @param nSwitchoverKey [IN] Switch key of access right
* @return Success, return MV_OK. Failure, return error code
* @remarks Find specific device and connect according to set device parameters. \n
When calling the interface, the input of nAccessMode and nSwitchoverKey is optional, and the device access mode is exclusive. Currently the device does not support the following preemption modes: MV_ACCESS_ExclusiveWithSwitch, MV_ACCESS_ControlWithSwitch, MV_ACCESS_ControlSwitchEnableWithKey.\n
For USB3Vision device, nAccessMode, nSwitchoverKey are invalid.
************************************************************************/
#ifndef __cplusplus
MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, IN unsigned int nAccessMode, IN unsigned short nSwitchoverKey);
#else
MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, IN unsigned int nAccessMode = MV_ACCESS_Exclusive, IN unsigned short nSwitchoverKey = 0);
#endif
/********************************************************************//**
* @~chinese
* @brief 关闭设备
* @param handle [IN] 设备句柄
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 通过MV_CC_OpenDevice连接设备后,可以通过该接口断开设备连接,释放资源
* @~english
* @brief Close Device
* @param handle [IN] Device handle
* @return Success, return MV_OK. Failure, return error code
* @remarks After connecting to device through MV_CC_OpenDevice, use this interface to disconnect and release resources.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_CloseDevice(IN void* handle);
/********************************************************************//**
* @~chinese
* @brief 判断设备是否处于连接状态
* @param handle [IN] 设备句柄
* @return 设备处于连接状态,返回true;没连接或失去连接,返回false
* @~english
* @brief Is The Device Connected
* @param handle [IN] Device handle
* @return Connected, return true. Not Connected or DIsconnected, return false
***********************************************************************/
MV_CAMCTRL_API bool __stdcall MV_CC_IsDeviceConnected(IN void* handle);
/********************************************************************//**
* @~chinese
* @brief 注册图像数据回调
* @param handle [IN] 设备句柄
* @param cbOutput [IN] 回调函数指针
* @param pUser [IN] 用户自定义变量
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用。 \n
图像数据采集有两种方式,两种方式不能复用:\n
方式一:调用MV_CC_RegisterImageCallBackEx设置图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回。\n
方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetOneFrameTimeout获取指定像素格式的帧数据,获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 \n
该接口不支持CameraLink设备。
* @~english
* @brief Register the image callback function
* @param handle [IN] Device handle
* @param cbOutput [IN] Callback function pointer
* @param pUser [IN] User defined variable
* @return Success, return MV_OK. Failure, return error code
* @remarks After MV_CC_CreateHandle, call this interface to set image data callback function.\n
There are two available image data acquisition modes, and cannot be used together: \n
Mode 1: Call MV_CC_RegisterImageCallBack to set image data callback function, and then callMV_CC_StartGrabbing to start acquiring. The acquired image data will return in the set callback function.\n
Mode 2: Call MV_CC_StartGrabbing to start acquiring, and then call MV_CC_GetOneFrameTimeout repeatedly in application layer to get frame data of specified pixel format. When getting frame data, the frequency of calling this interface should be controlled by upper layer application according to frame rate. \n
This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackEx(void* handle,
void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),
void* pUser);
/********************************************************************//**
* @~chinese
* @brief 注册图像数据回调,RGB
* @param handle [IN] 设备句柄
* @param cbOutput [IN] 回调函数指针
* @param pUser [IN] 用户自定义变量
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用。 \n
图像数据采集有两种方式,两种方式不能复用:\n
方式一:调用MV_CC_RegisterImageCallBackForRGB设置RGB24格式图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回。\n
方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetImageForRGB获取RGB24格式的帧数据,获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 \n
该接口不支持CameraLink设备。
* @~english
* @brief register image data callback, RGB
* @param handle [IN] Device handle
* @param cbOutput [IN] Callback function pointer
* @param pUser [IN] User defined variable
* @return Success, return MV_OK. Failure, return error code
* @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle. \n
There are two image acquisition modes, the two modes cannot be reused: \n
Mode 1: Call MV_CC_RegisterImageCallBackForRGB to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function.\n
Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForRGB repeatedly in application layer to get frame data with RGB24 format. When getting frame data, the upper application program should control the frequency of calling this API according to frame rate. \n
This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackForRGB(void* handle,
void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),
void* pUser);
/********************************************************************//**
* @~chinese
* @brief 注册图像数据回调,BGR
* @param handle [IN] 设备句柄
* @param cbOutput [IN] 回调函数指针
* @param pUser [IN] 用户自定义变量
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用。\n
图像数据采集有两种方式,两种方式不能复用:\n
方式一:调用MV_CC_RegisterImageCallBackForBGR设置BGR24图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回。\n
方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetImageForBGR获取BGR24格式的帧数据,获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 \n
该接口不支持CameraLink设备。
* @~english
* @brief register image data callback, BGR
* @param handle [IN] Device handle
* @param cbOutput [IN] Callback function pointer
* @param pUser [IN] User defined variable
* @return Success, return MV_OK. Failure, return error code
* @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle. \n
There are two image acquisition modes, the two modes cannot be reused: \n
Mode 1: Call MV_CC_RegisterImageCallBackForBGR to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function.\n
Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForBGR repeatedly in application layer to get frame data with BGR24 format. When getting frame data, the upper application program should control the frequency of calling this API according to frame rate.\n
This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackForBGR(void* handle,
void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),
void* pUser);
/********************************************************************//**
* @~chinese
* @brief 开始取流
* @param handle [IN] 设备句柄
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 该接口不支持CameraLink设备。
* @~english
* @brief Start Grabbing
* @param handle [IN] Device handle
* @return Success, return MV_OK. Failure, return error code
* @remarks This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_StartGrabbing(IN void* handle);
/********************************************************************//**
* @~chinese
* @brief 停止取流
* @param handle [IN] 设备句柄
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 该接口不支持CameraLink设备。
* @~english
* @brief Stop Grabbing
* @param handle [IN] Device handle
* @return Success, return MV_OK. Failure, return error code
* @remarks This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_StopGrabbing(IN void* handle);
/********************************************************************//**
* @~chinese
* @brief 获取一帧RGB数据,此函数为查询式获取,每次调用查询内部
缓存有无数据,有数据则获取数据,无数据返回错误码
* @param handle [IN] 设备句柄
* @param pData [OUT] 图像数据接收指针
* @param nDataSize [IN] 接收缓存大小
* @param pstFrameInfo [OUT] 图像信息结构体
* @param nMsec [IN] 等待超时时间
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 每次调用该接口,将查询内部缓存是否有数据,如果有数据则转换成RGB24格式返回,如果没有数据则返回错误码。因为图像转换成RGB24格式有耗时,所以当数据帧率过高时该接口可能会导致丢帧。\n
调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。 \n
该接口不支持CameraLink设备。
* @~english
* @brief Get one frame of RGB data, this function is using query to get data
query whether the internal cache has data, get data if there has, return error code if no data
* @param handle [IN] Device handle
* @param pData [OUT] Image data receiving buffer
* @param nDataSize [IN] Buffer size
* @param pstFrameInfo [OUT] Image information structure
* @param nMsec [IN] Waiting timeout
* @return Success, return MV_OK. Failure, return error code
* @remarks Each time the API is called, the internal cache is checked for data. If there is data, it will be transformed as RGB24 format for return, if there is no data, return error code. As time-connSuming exists when transform the image to RGB24 format, this API may cause frame loss when the data frame rate is too high. \n
Before calling this API to get image data frame, call MV_CC_StartGrabbing to start image acquisition. This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. \n
This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetImageForRGB(IN void* handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, int nMsec);
/********************************************************************//**
* @~chinese
* @brief 获取一帧BGR数据,此函数为查询式获取,每次调用查询内部
缓存有无数据,有数据则获取数据,无数据返回错误码
* @param handle [IN] 设备句柄
* @param pData [OUT] 图像数据接收指针
* @param nDataSize [IN] 接收缓存大小
* @param pstFrameInfo [OUT] 图像信息结构体
* @param nMsec [IN] 等待超时时间
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 每次调用该接口,将查询内部缓存是否有数据,如果有数据则转换成BGR24格式返回,如果没有数据则返回错误码。因为图像转换成BGR24格式有耗时,所以当数据帧率过高时该接口可能会导致丢帧。 \n
调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。\n
该接口不支持CameraLink设备。
* @~english
* @brief Get one frame of BGR data, this function is using query to get data
query whether the internal cache has data, get data if there has, return error code if no data
* @param handle [IN] Device handle
* @param pData [OUT] Image data receiving buffer
* @param nDataSize [IN] Buffer size
* @param pstFrameInfo [OUT] Image information structure
* @param nMsec [IN] Waiting timeout
* @return Success, return MV_OK. Failure, return error code
* @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle. \n
There are two image acquisition modes, the two modes cannot be reused: \n
Mode 1: Call MV_CC_RegisterImageCallBackForBGR to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function.\n
Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForBGR repeatedly in application layer to get frame data with BGR24 format. When getting frame data, the upper application program should control the frequency of calling this API according to frame rate. \n
This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetImageForBGR(IN void* handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, int nMsec);
/********************************************************************//**
* @~chinese
* @brief 使用内部缓存获取一帧图片(与MV_CC_Display不能同时使用)
* @param handle [IN] 设备句柄
* @param pstFrame [OUT] 图像数据和图像信息
* @param nMsec [IN] 等待超时时间,输入INFINITE时表示无限等待,直到收到一帧数据或者停止取流
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。该接口支持设置超时时间,SDK内部等待直到有数据时返回,可以增加取流平稳性,适合用于对平稳性要求较高的场合。 \n
该接口与MV_CC_FreeImageBuffer配套使用,当处理完取到的数据后,需要用MV_CC_FreeImageBuffer接口将pFrame内的数据指针权限进行释放。 \n
该接口与MV_CC_GetOneFrameTimeout相比,有着更高的效率。且其取流缓存的分配是由sdk内部自动分配的,而MV_CC_GetOneFrameTimeout接口是需要客户自行分配。\n
该接口在调用MV_CC_Display后无法取流。 \n
该接口对于U3V、GIGE设备均可支持。 \n
该接口不支持CameraLink设备。
* @~english
* @brief Get a frame of an image using an internal cache
* @param handle [IN] Device handle
* @param pstFrame [OUT] Image data and image information
* @param nMsec [IN] Waiting timeout
* @return Success, return MV_OK. Failure, return error code
* @remarks Before calling this API to get image data frame, you should call MV_CC_StartGrabbing to start image acquisition. This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. This API support setting timeout, and SDK will wait to return until data appears. This function will increase the streaming stability, which can be used in the situation with high stability requirement. \n
This API and MV_CC_FreeImageBuffer should be called in pairs, after processing the acquired data, you should call MV_CC_FreeImageBuffer to release the data pointer permission of pFrame. \n
This interface is more efficient than MV_CC_GetOneFrameTimeout. The allocation of the stream cache is automatically allocated within the SDK.The MV_CC_GetOneFrameTimeout interface needs to be allocated by customers themselves. \n
This API cannot be called to stream after calling MV_CC_Display. \n
This API is not supported by CameraLink device. \n
This API is supported by both USB3 vision camera and GigE camera. \n
**********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetImageBuffer(IN void* handle, OUT MV_FRAME_OUT* pstFrame, IN unsigned int nMsec);
/********************************************************************//**
* @~chinese
* @brief 释放图像缓存(此接口用于释放不再使用的图像缓存,与MV_CC_GetImageBuffer配套使用)
* @param handle [IN] 设备句柄
* @param pstFrame [IN] 图像数据和图像数据
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 该接口与MV_CC_GetImageBuffer配套使用,使用MV_CC_GetImageBuffer接口取到的图像数据pFrame,需要用MV_CC_FreeImageBuffer接口进行权限释放。 \n
该接口对于取流效率高于GetOneFrameTimeout接口,且GetImageBuffer在不进行Free的情况下,最大支持输出的节点数与SetImageNode接口所设置的节点数相等,默认节点数是1。\n
该接口对于U3V、GIGE设备均可支持。 \n
该接口不支持CameraLink设备。
* @~english
* @brief Free image buffer(this interface can free image buffer, used with MV_CC_GetImageBuffer)
* @param handle [IN] Device handle
* @param pstFrame [IN] Image data and image information
* @return Success, return MV_OK. Failure, return error code
* @remarks This API and MV_CC_GetImageBuffer should be called in pairs, before calling MV_CC_GetImageBuffer to get image data pFrame, you should call MV_CC_FreeImageBuffer to release the permission. \n
Compared with API MV_CC_GetOneFrameTimeout, this API has higher efficiency of image acquisition. The max. number of nodes can be outputted is same as the "num" of API MV_CC_SetImageNodeNum, default value is 1. \n
This API is not supported by CameraLink device. \n
This API is supported by both USB3 vision camera and GigE camera.
**********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_FreeImageBuffer(IN void* handle, IN MV_FRAME_OUT* pstFrame);
/********************************************************************//**
* @~chinese
* @brief 采用超时机制获取一帧图片,SDK内部等待直到有数据时返回
* @param handle [IN] 设备句柄
* @param pData [OUT] 图像数据接收指针
* @param nDataSize [IN] 接收缓存大小
* @param pstFrameInfo [OUT] 图像信息结构体
* @param nMsec [IN] 等待超时时间
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。该接口支持设置超时时间,SDK内部等待直到有数据时返回,可以增加取流平稳性,适合用于对平稳性要求较高的场合。\n
该接口对于U3V、GIGE设备均可支持。\n
该接口不支持CameraLink设备。
* @~english
* @brief Timeout mechanism is used to get image, and the SDK waits inside until the data is returned
* @param handle [IN] Device handle
* @param pData [OUT] Image data receiving buffer
* @param nDataSize [IN] Buffer size
* @param pstFrameInfo [OUT] Image information structure
* @param nMsec [IN] Waiting timeout
* @return Success, return MV_OK. Failure, return error code
* @remarks Before calling this API to get image data frame, call MV_CC_StartGrabbing to start image acquisition. This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. This API supports setting timeout, SDK will wait to return until data appears. This function will increase the streaming stability, which can be used in the situation with high stability requirement. \n
Both the USB3Vision and GIGE camera can support this API. \n
This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetOneFrameTimeout(IN void* handle, IN OUT unsigned char* pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, unsigned int nMsec);
/********************************************************************//**
* @~chinese
* @brief 清除取流数据缓存
* @param handle [IN] 设备句柄
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 该接口允许用户在不停止取流的时候,就能清除缓存中不需要的图像。\n
该接口在连续模式切触发模式后,可以清除历史数据。
* @~english
* @brief if Image buffers has retrieved the data,Clear them
* @param handle [IN] Device handle
* @return Success, return MV_OK. Failure, return error code
* @remarks This interface allows user to clear the unnecessary images from the buffer memory without stopping acquisition. \n
This interface allows user to clear previous data after switching from continuous mode to trigger mode.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_ClearImageBuffer(IN void* handle);
/********************************************************************//**
* @~chinese
* @brief 显示一帧图像
* @param handle [IN] 设备句柄
* @param pstDisplayInfo [IN] 图像信息
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 该接口对于U3V、GIGE设备均可支持。\n
该接口不支持CameraLink设备。
* @~english
* @brief Display one frame image
* @param handle [IN] Device handle
* @param pstDisplayInfo [IN] Frame Info
* @return Success, return MV_OK. Failure, return error code
* @remarks This API is valid for USB3Vision camera and GIGE camera. \n
This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_DisplayOneFrame(IN void* handle, IN MV_DISPLAY_FRAME_INFO* pstDisplayInfo);
/********************************************************************//**
* @~chinese
* @brief 设置SDK内部图像缓存节点个数,大于等于1,在抓图前调用
* @param handle [IN] 设备句柄
* @param num [IN] 缓存节点个数
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 调用该接口可以设置SDK内部图像缓存节点个数,在调用MV_CC_StartGrabbing开始抓图前调用。\n
在SDK中默认是1个节点。\n
该接口不支持CameraLink设备。
* @~english
* @brief Set the number of the internal image cache nodes in SDK, Greater than or equal to 1, to be called before the capture
* @param handle [IN] Device handle
* @param num [IN] Image Node Number
* @return Success, return MV_OK. Failure, return error code
* @remarks Call this interface to set the number of SDK internal image buffer nodes. The interface should be called before calling MV_CC_StartGrabbing for capturing. \n
This API is not supported by CameraLink device.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetImageNodeNum(IN void* handle, unsigned int num);
/********************************************************************//**
* @~chinese
* @brief 设置取流策略
* @param handle [IN] 设备句柄
* @param enGrabStrategy [IN] 策略枚举值
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 该接口定义了四种取流策略,用户可以根据实际需求进行选择。具体描述如下:
-OneByOne:从旧到新一帧一帧的从输出缓存列表中获取图像,打开设备后默认为该策略
-LatestImagesOnly:仅从输出缓存列表中获取最新的一帧图像,同时清空输出缓存列表
-LatestImages:从输出缓存列表中获取最新的OutputQueueSize帧图像,其中OutputQueueSize范围为1-ImageNodeNum,可用MV_CC_SetOutputQueueSize接口设置,ImageNodeNum默认为1,可用MV_CC_SetImageNodeNum接口设置 OutputQueueSize设置成1等同于LatestImagesOnly策略,OutputQueueSize设置成ImageNodeNum等同于OneByOne策略
-UpcomingImage:在调用取流接口时忽略输出缓存列表中所有图像,并等待设备即将生成的一帧图像。该策略只支持GigE设备,不支持U3V设备
* @~english
* @brief Set Grab Strategy
* @param handle [IN] Device handle
* @param enGrabStrategy [IN] The value of Grab Strategy
* @return Success, return MV_OK. Failure, return error code
* @remarks This interface is set by four image acquisition approaches, the user may choose one as needed. Specific details are as followed:
-OneByOne:Obtain image from output cache list frame by frame in order, this function is default strategy when device is on.
-LatestImagesOnly:Obtain the latest image from output cache list only, meanwhile clear output cache list.
-LatestImages:Obtain the latest OutputQueueSize image from output cache list, the range of OutputQueueSize is 1-ImageNodeNum, the user may set the value of MV_CC_SetOutputQueueSizeinterface,the default value of ImageNodeNum is 1,If the user usesMV_CC_SetImageNodeNuminterface to set up OutputQueueSize,when the value of OutputQueueSize is set to be 1, the function will be same as LatestImagesOnly; if the value of OutputQueueSize is set to be ImageNodeNum, the function will be same as OneByOne.
-UpcomingImage:Ignore all images in output cache list when calling image acuiqisiotn interface, wait the next upcoming image generated. Support for GigE camera only, not support for U3V camera.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetGrabStrategy(IN void* handle, IN MV_GRAB_STRATEGY enGrabStrategy);
/********************************************************************//**
* @~chinese
* @brief 设置输出缓存个数(只有在MV_GrabStrategy_LatestImages策略下才有效,范围:1-ImageNodeNum)
* @param handle [IN] 设备句柄
* @param nOutputQueueSize [IN] 输出缓存个数
* @return 成功,返回MV_OK;错误,返回错误码
* @remarks 该接口需与LatestImages取流策略配套调用,用于设置LatestImages策略下最多允许缓存图像的个数。可以在取流过程中动态调节输出缓存个数
* @~english
* @brief Set The Size of Output Queue(Only work under the strategy of MV_GrabStrategy_LatestImages,rang:1-ImageNodeNum)
* @param handle [IN] Device handle
* @param nOutputQueueSize [IN] The Size of Output Queue
* @return Success, return MV_OK. Failure, return error code
* @remarks This interface must be used with LatestImages Grab strategy, it is used for setting the maximum allowance queue size of the image under the LatestImages strategy. The user may change the output queue size while grabbing images.
***********************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetOutputQueueSize(IN void* handle, IN unsigned int nOutputQueueSize);
/********************************************************************//**
* @~chinese
* @brief 获取设备信息,取流之前调用
* @param handle [IN] 设备句柄
* @param pstDevInfo [IN][OUT] 返回给调用者有关设备信息结构体指针
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 支持用户在打开设备后获取设备信息。\n
若该设备是GigE设备,则调用该接口存在阻塞风险,因此不建议在取流过程中调用该接口。
* @~english
* @brief Get device information
* @param handle [IN] Device handle
* @param pstDevInfo [IN][OUT] Structure pointer of device information
* @return Success, return MV_OK. Failure, return error code
* @remarks The API support users to access device information after opening the device. \n
If the device is a GigE camera, there is a blocking risk in calling the interface, so it is not recommended to call the interface during the fetching process.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetDeviceInfo(IN void * handle, IN OUT MV_CC_DEVICE_INFO* pstDevInfo);
/********************************************************************//**
* @~chinese
* @brief 获取各种类型的信息
* @param handle [IN] 设备句柄
* @param pstInfo [IN][OUT] 返回给调用者有关设备各种类型的信息结构体指针
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 接口里面输入需要获取的信息类型(指定MV_ALL_MATCH_INFO结构体中的nType类型),获取对应的信息(在MV_ALL_MATCH_INFO结构体中pInfo里返回)。 \n
该接口的调用前置条件取决于所获取的信息类型,获取GigE设备的MV_MATCH_TYPE_NET_DETECT信息需在开启抓图之后调用,获取U3V设备的MV_MATCH_TYPE_USB_DETECT信息需在打开设备之后调用。 \n
该接口不支持CameraLink设备。
* @~english
* @brief Get various type of information
* @param handle [IN] Device handle
* @param pstInfo [IN][OUT] Structure pointer of various type of information
* @return Success, return MV_OK. Failure, return error code
* @remarks Input required information type (specify nType in structure MV_ALL_MATCH_INFO) in the interface and get corresponding information (return in pInfo of structure MV_ALL_MATCH_INFO). \n
The calling precondition of this interface is determined by obtained information type. Call after enabling capture to get MV_MATCH_TYPE_NET_DETECT information of GigE device, and call after starting device to get MV_MATCH_TYPE_USB_DETECT information of USB3Vision device. \n
This API is not supported by CameraLink device.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetAllMatchInfo(IN void* handle, IN OUT MV_ALL_MATCH_INFO* pstInfo);
/************************************************************************/
/* 设置和获取设备参数的万能接口 */
/* General interface for getting and setting camera parameters */
/************************************************************************/
/********************************************************************//**
* @~chinese
* @brief 获取Integer属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值,如获取宽度信息则为"Width"
* @param pstIntValue [IN][OUT] 返回给调用者有关设备属性结构体指针
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以获取int类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IInteger”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Get Integer value
* @param handle [IN] Device handle
* @param strKey [IN] Key value, for example, using "Width" to get width
* @param pstIntValue [IN][OUT] Structure pointer of camera features
* @return Success, return MV_OK. Failure, return error code
* @remarks You can call this API to get the value of camera node with integer type after connecting the device. For strKey value, refer to mv_cameraNode. All the node values of "IInteger" in the list can be obtained via this API. strKey corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetIntValueEx(IN void* handle,IN const char* strKey,OUT MVCC_INTVALUE_EX *pstIntValue);
/********************************************************************//**
* @~chinese
* @brief 设置Integer型属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值,如获取宽度信息则为"Width"
* @param nValue [IN] 想要设置的设备的属性值
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以设置int类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IInteger”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Set Integer value
* @param handle [IN] Device handle
* @param strKey [IN] Key value, for example, using "Width" to set width
* @param nValue [IN] Feature value to set
* @return Success, return MV_OK. Failure, return error code
* @remarks You can call this API to get the value of camera node with integer type after connecting the device. For strKey value, refer to mv_cameraNode. All the node values of "IInteger" in the list can be obtained via this API. strKey corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetIntValueEx(IN void* handle,IN const char* strKey,IN int64_t nValue);
/********************************************************************//**
* @~chinese
* @brief 获取Enum属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
* @param pstEnumValue [IN][OUT] 返回给调用者有关设备属性结构体指针
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以获取Enum类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IEnumeration”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Get Enum value
* @param handle [IN] Device handle
* @param strKey [IN] Key value, for example, using "PixelFormat" to get pixel format
* @param pstEnumValue [IN][OUT] Structure pointer of camera features
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to get specified Enum nodes. For value of strKey, see mv_cameraNode, The node values of IEnumeration can be obtained through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetEnumValue(IN void* handle,IN const char* strKey,OUT MVCC_ENUMVALUE *pstEnumValue);
/********************************************************************//**
* @~chinese
* @brief 设置Enum型属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
* @param nValue [IN] 想要设置的设备的属性值
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以设置Enum类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IEnumeration”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Set Enum value
* @param handle [IN] Device handle
* @param strKey [IN] Key value, for example, using "PixelFormat" to set pixel format
* @param nValue [IN] Feature value to set
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to get specified Enum nodes. For value of strKey, see mv_cameraNode, The node values of IEnumeration can be obtained through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetEnumValue(IN void* handle,IN const char* strKey,IN unsigned int nValue);
/********************************************************************//**
* @~chinese
* @brief 设置Enum型属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat"
* @param strValue [IN] 想要设置的设备的属性字符串
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以设置Enum类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IEnumeration”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Set Enum value
* @param handle [IN] Device handle
* @param strKey [IN] Key value, for example, using "PixelFormat" to set pixel format
* @param strValue [IN] Feature String to set
* @return Success, return MV_OK. Failure, return error code
* @remarks Call this API after connecting the device. All the values of nodes with IEnumeration type can be set via this API.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetEnumValueByString(IN void* handle,IN const char* strKey,IN const char* strValue);
/********************************************************************//**
* @~chinese
* @brief 获取Float属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值
* @param pstFloatValue [IN][OUT] 返回给调用者有关设备属性结构体指针
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以获取float类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IFloat”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Get Float value
* @param handle [IN] Device handle
* @param strKey [IN] Key value
* @param pstFloatValue [IN][OUT] Structure pointer of camera features
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to get specified float node. For detailed strKey value see: mv_cameraNode. The node values of IFloat can be obtained through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetFloatValue(IN void* handle,IN const char* strKey,OUT MVCC_FLOATVALUE *pstFloatValue);
/********************************************************************//**
* @~chinese
* @brief 设置float型属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值
* @param fValue [IN] 想要设置的设备的属性值
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以设置float类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IFloat”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Set float value
* @param handle [IN] Device handle
* @param strKey [IN] Key value
* @param fValue [IN] Feature value to set
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to set specified float node. For detailed strKey value see: mv_cameraNode. The node values of IFloat can be set through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetFloatValue(IN void* handle,IN const char* strKey,IN float fValue);
/********************************************************************//**
* @~chinese
* @brief 获取Boolean属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值
* @param pbValue [IN][OUT] 返回给调用者有关设备属性值
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以获取bool类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IBoolean”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Get Boolean value
* @param handle [IN] Device handle
* @param strKey [IN] Key value
* @param pbValue [IN][OUT] Structure pointer of camera features
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to get specified bool nodes. For value of strKey, see mv_cameraNode. The node values of IBoolean can be obtained through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetBoolValue(IN void* handle,IN const char* strKey,OUT bool *pbValue);
/********************************************************************//**
* @~chinese
* @brief 设置Boolean型属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值
* @param bValue [IN] 想要设置的设备的属性值
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以设置bool类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IBoolean”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Set Boolean value
* @param handle [IN] Device handle
* @param strKey [IN] Key value
* @param bValue [IN] Feature value to set
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to set specified bool nodes. For value of strKey, see mv_cameraNode. The node values of IBoolean can be set through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetBoolValue(IN void* handle,IN const char* strKey,IN bool bValue);
/********************************************************************//**
* @~chinese
* @brief 获取String属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值
* @param pstStringValue [IN][OUT] 返回给调用者有关设备属性结构体指针
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以获取string类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IString”的节点值都可以通过该接口获取,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Get String value
* @param handle [IN] Device handle
* @param strKey [IN] Key value
* @param pstStringValue [IN][OUT] Structure pointer of camera features
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to get specified string nodes. For value of strKey, see mv_cameraNode. The node values of IString can be obtained through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetStringValue(IN void* handle,IN const char* strKey,OUT MVCC_STRINGVALUE *pstStringValue);
/********************************************************************//**
* @~chinese
* @brief 设置String型属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值
* @param strValue [IN] 想要设置的设备的属性值
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以设置string类型的指定节点的值。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“IString”的节点值都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Set String value
* @param handle [IN] Device handle
* @param strKey [IN] Key value
* @param strValue [IN] Feature value to set
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to set specified string nodes. For value of strKey, see mv_cameraNode. The node values of IString can be set through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetStringValue(IN void* handle,IN const char* strKey,IN const char* strValue);
/********************************************************************//**
* @~chinese
* @brief 设置Command型属性值
* @param handle [IN] 设备句柄
* @param strKey [IN] 属性键值
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 连接设备之后调用该接口可以设置指定的Command类型节点。strKey取值可以参考XML节点参数类型列表,表格里面数据类型为“ICommand”的节点都可以通过该接口设置,strKey参数取值对应列表里面的“名称”一列。
* @~english
* @brief Send Command
* @param handle [IN] Device handle
* @param strKey [IN] Key value
* @return Success, return MV_OK. Failure, return error code
* @remarks After the device is connected, call this interface to set specified Command nodes. For value of strKey, see mv_cameraNode. The node values of ICommand can be set through this interface, strKey value corresponds to the Name column.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_SetCommandValue(IN void* handle,IN const char* strKey);
/********************************************************************//**
* @~chinese
* @brief 清除GenICam节点缓存
* @param handle [IN] 设备句柄
* @return 成功,返回MV_OK;错误,返回错误码
* @~english
* @brief Invalidate GenICam Nodes
* @param handle [IN] Device handle
* @return Success, return MV_OK. Failure, return error code
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_InvalidateNodes(IN void* handle);
/************************************************************************/
/* 设备升级 和 寄存器读写 和异常、事件回调 */
/* Device upgrade, register read and write and exception callback */
/************************************************************************/
/********************************************************************//**
* @~chinese
* @brief 设备本地升级
* @param handle [IN] 设备句柄
* @param G_pstrFilePathName [IN] 文件名
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 通过该接口可以将升级固件文件发送给设备进行升级。该接口需要等待升级固件文件成功传给设备端之后再返回,响应时间可能较长。
* @~english
* @brief Device Local Upgrade
* @param handle [IN] Device handle
* @param G_pstrFilePathName [IN] File name
* @return Success, return MV_OK. Failure, return error code
* @remarks Call this API to send the upgrade firmware to the device for upgrade. This API will wait for return until the upgrade firmware is sent to the device, this response may take a long time. \n
For CameraLink device, it keeps sending upgrade firmware continuously.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_LocalUpgrade(IN void* handle, const void* G_pstrFilePathName);
/********************************************************************//**
* @~chinese
* @brief 获取升级进度
* @param handle [IN] 设备句柄
* @param pnProcess [OUT] 进度接收地址
* @return 成功,返回MV_OK,失败,返回错误码
* @~english
* @brief Get Upgrade Progress
* @param handle [IN] Device handle
* @param pnProcess [OUT] Progress receiving afFileress
* @return Success, return MV_OK. Failure, return error code
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_GetUpgradeProcess(IN void* handle, unsigned int* pnProcess);
/********************************************************************//**
* @~chinese
* @brief 读内存
* @param handle [IN] 设备句柄
* @param pBuffer [IN][OUT] 作为返回值使用,保存读到的内存值(GEV设备内存值是按照大端模式存储的,其它协议设备按照小端存储)
* @param nAfFileress [IN] 待读取的内存地址,该地址可以从设备的Camera.xml文件中获取,形如vXFramex_RegAfFiler的xml节点值
* @param nLength [IN] 待读取的内存长度
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 访问设备,读取某段寄存器的数据。
* @~english
* @brief Read Memory
* @param handle [IN] Device Handle
* @param pBuffer [IN][OUT] Used as a return value, save the read-in memory value ( Memory value is stored in accordance with the big end model)
* @param nAfFileress [IN] Memory afFileress to be read, which can be obtained from the Camera.xml file of the device, the form xml node value of vXFramex_RegAfFiler
* @param nLength [IN] Length of the memory to be read
* @return Success, return MV_OK. Failure, return error code
* @remarks Access device, read the data from certain register.
*************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_ReadMemory(IN void* handle , void *pBuffer, int64_t nAfFileress, int64_t nLength);
/********************************************************************//**
* @~chinese
* @brief 写内存
* @param handle [IN] 设备句柄
* @param pBuffer [IN] 待写入的内存值(注意GEV设备内存值要按照大端模式存储,其它协议设备按照小端存储)
* @param nAfFileress [IN] 待写入的内存地址,该地址可以从设备的Camera.xml文件中获取,形如vXFramex_RegAfFiler的xml节点值
* @param nLength [IN] 待写入的内存长度
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 访问设备,把一段数据写入某段寄存器。
* @~english
* @brief Write Memory
* @param handle [IN] Device Handle
* @param pBuffer [IN] Memory value to be written ( Note the memory value to be stored in accordance with the big end model)
* @param nAfFileress [IN] Memory afFileress to be written, which can be obtained from the Camera.xml file of the device, the form xml node value of vXFramex_RegAfFiler
* @param nLength [IN] Length of the memory to be written
* @return Success, return MV_OK. Failure, return error code
* @remarks Access device, write a piece of data into a certain segment of register.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_WriteMemory(IN void* handle, const void *pBuffer, int64_t nAfFileress, int64_t nLength);
/********************************************************************//**
* @~chinese
* @brief 注册异常消息回调,在打开设备之后调用
* @param handle [IN] 设备句柄
* @param cbException [IN] 异常回调函数指针
* @param pUser [IN] 用户自定义变量
* @return 成功,返回MV_OK,失败,返回错误码
* @remarks 该接口需要在MV_CC_OpenDevice打开设备之后调用。设备异常断开连接后可以在回调里面获取到异常消息,GigE设备掉线之后需要先调用MV_CC_CloseDevice接口关闭设备,再调用MV_CC_OpenDevice接口重新打开设备。
* @~english
* @brief Register Exception Message CallBack, call after open device
* @param handle [IN] Device handle
* @param cbException [IN] Exception Message CallBack Function Pointer
* @param pUser [IN] User defined variable
* @return Success, return MV_OK. Failure, return error code
* @remarks Call this interface after the device is opened by MV_CC_OpenDevice. When device is exceptionally disconnected, the exception message can be obtained from callback function. For Disconnected GigE device, first call MV_CC_CloseDevice to shut device, and then call MV_CC_OpenDevice to reopen the device.
************************************************************************/
MV_CAMCTRL_API int __stdcall MV_CC_RegisterExceptionCallBack(IN void* handle,
void(__stdcall* cbException)(unsigned int nMsgType, void* pUser), void* pUser);
/********************************************************************//**
* @~chinese
* @brief 注册全部事件回调,在打开设备之后调用
* @param handle [IN] 设备句柄
* @param cbEvent [IN] 事件回调函数指针
* @param pUser [IN] 用户自定义变量