matrox 采集卡

  1. // MilApp.cpp   
  1. //   
  1. /*---------------------------------------------
  1. 本 Demo 以 Cronosplus 采集 CCIR 信号为例。
  1. 实现功能:连续采集,单帧抓取,保存图片,显示
  1. 注意:1) 请将 MsysAlloc 的第一项参数改成您所使用的板卡类型
  1.       2) 请将 MdigAlloc 的第三项参数改成您所使用的 dcf 文件
  1. -----------------------------------------------*/  
  1.   
  1.   
  1. #include "stdafx.h"   
  1. #include "MilApp.h"   
  1.   
  1. MIL_ID MilApplication;  
  1. MIL_ID MilSystem;  
  1. MIL_ID MilDigitizer;  
  1. MIL_ID MilDisplay;  
  1. MIL_ID MilImage;  
  1.   
  1. char g_aFileNameOfDCF[31]="dcffile.dcf";  
  1.   
  1. //MiL初始化   
  1. bool MilCreate()   
  1. {  
  1.     /* 分配 App */  
  1.     MappAlloc(M_DEFAULT, &MilApplication);  
  1.     /* 分配 system. */  
  1.     MsysAlloc(M_SYSTEM_CRONOSPLUS, M_DEF_SYSTEM_NUM, M_SETUP, &MilSystem);  
  1.     /*分配 digitizer. */  
  1.     MdigAlloc(MilSystem,   
  1.              M_DEFAULT,   
  1.              "M_CCIR", M_DEFAULT,   
  1.              &MilDigitizer);  
  1.     /* 分配 display. */  
  1.     MdispAlloc(MilSystem,   
  1.                M_DEFAULT,   
  1.                M_DISPLAY_SETUP,   
  1.                M_WINDOWED,   
  1.                &MilDisplay);  
  1.   
  1.     long g_BufSizeX    = (unsigned int) MdigInquire(MilDigitizer, M_SIZE_X, M_NULL);  
  1.     long g_BufSizeY    = (unsigned int) MdigInquire(MilDigitizer, M_SIZE_Y, M_NULL);  
  1.     long g_BufSizeBand = (unsigned int) MdigInquire(MilDigitizer, M_SIZE_BAND, M_NULL);  
  1.   
  1.     /* 分配 buffer. */  
  1.     MbufAlloc2d(MilSystem,    
  1.                g_BufSizeX,  
  1.                g_BufSizeY,  
  1.                8L+M_UNSIGNED,   
  1.                M_IMAGE+M_GRAB+M_PROC+M_DISP,   
  1.                &MilImage);  
  1.     MbufClear(MilImage, 0);  
  1.   
  1.     return true;  
  1. }  
  1.   
  1.   
  1. //MiL资源释放   
  1. bool MilDestroy()  
  1. {  
  1.     MdispDeselect(MilDisplay, MilImage);  
  1.     MbufFree(MilImage);  
  1.     MdispFree(MilDisplay);  
  1.     MdigFree(MilDigitizer);  
  1.     MsysFree(MilSystem);  
  1.     MappFree(MilApplication);  
  1.   
  1.     return true;  
  1. }  
  1.   
  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值