-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGXCamera.cpp
More file actions
executable file
·68 lines (51 loc) · 1.46 KB
/
GXCamera.cpp
File metadata and controls
executable file
·68 lines (51 loc) · 1.46 KB
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
#include "GXCamera.h"
GXCamera::GXCamera()
{
g_hDevice= NULL;
}
GXCamera::~GXCamera()
{
// if (m_hDevHandle)
{
// MV_CC_DestroyHandle(m_hDevHandle);
// m_hDevHandle = MV_NULL;
}
}
// ch:枚举设备 | en:Enumerate Device
int GXCamera::EnumDevices(uint32_t* punNumDevices, uint32_t nTimeOut)
{
return GXUpdateAllDeviceList(punNumDevices, nTimeOut);
}
// ch:打开设备 | en:Open Device
int GXCamera::Open(GX_OPEN_PARAM* pOpenParam, GX_DEV_HANDLE* phDevice)
{
int ret=GXOpenDevice(pOpenParam, phDevice);
// g_hDevice = phDevice;
memcpy(&g_hDevice,phDevice,sizeof (GX_DEV_HANDLE));
return ret;
}
// ch:关闭设备 | en:Close Device
int GXCamera::Close()
{
return GXCloseLib();
}
// ch:注册图像数据回调 | en:Register Image Data CallBack
int GXCamera::RegisterImageCallBack (GX_DEV_HANDLE hDevice, void *pUserParam, GXCaptureCallBack callBackFun)
{
// return MV_CC_RegisterImageCallBackForBGR(m_hDevHandle, cbOutput, pUser);
return GXRegisterCaptureCallback(hDevice,(void *)pUserParam,(GXCaptureCallBack)callBackFun);;
}
// ch:开启抓图 | en:Start Grabbing
int GXCamera::StartGrabbing()
{
return GXStreamOn(g_hDevice);
}
// ch:停止抓图 | en:Stop Grabbing
int GXCamera::StopGrabbing()
{
return GXStreamOff(g_hDevice);
}
int GXCamera::CommandExecute(GX_FEATURE_ID_CMD featureID)
{
return GXSendCommand(g_hDevice, featureID);
}