30 lines
938 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

请结合手册提供的回调函数注册代码,使用 lambda 函数的方式,实现类 `` 中的注册回调函数功能
```cpp
/* 相机 SDK 示例代码 */
void __stdcall ImageCallBackEx(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser)
{
if (pFrameInfo)
{
printf("Get One Frame: Width[%d], Height[%d], FrameLen[%I64d] nFrameNum[%d]\n",
pFrameInfo->nExtendWidth, pFrameInfo->nExtendHeight, pFrameInfo->nFrameLenEx,pFrameInfo->nFrameNum);
// pData 是图像指针pFrameInfo->nFrameLenEx 是图像长度, 可以进行图像处理
}
}
// 注册抓图回调
nRet = MV_CC_RegisterImageCallBackEx(handle, ImageCallBackEx, handle);
Check(nRet);
// 设置缓存节点个数
nRet = MV_CC_SetImageNodeNum(handle, 5);
Check(nRet);
// 开始取流
nRet = MV_CC_StartGrabbing(handle);
Check(nRet);
/* 类中代码 */
// 注册图像回调函数
void registerImageCallback();
```