⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pvcamopen.c

📁 SDFGASFASFASFAS EDGSGA DGSFGSA
💻 C
字号:
/* PVCAMOPEN - opens PVCAM device

      HCAM = PVCAMOPEN(NCAMERA) opens and initializes the PVCAM device specified
	  by NCAM and returns a handle to the open camera HCAM.  NCAM is an integer
	  from 0 to NCAMERA - 1.  If unsuccessful, HCAM = []. */


/* 2/19/03 SCM */


// inclusions
#include "pvcamutil.h"


// gateway routine
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {

	// declarations
	int16		hcam;		// camera handle
	int16		ncam;		// camera number

	// validate arguments
	if ((nrhs != 1) || (nlhs > 1)) {
        mexErrMsgTxt("type 'help pvcamopen' for syntax");
    }

	// obtain camera handle
	if (!mxIsNumeric(prhs[0])) {
		mexErrMsgTxt("NCAMERA must be numeric");
	}
	else if (mxGetNumberOfElements(prhs[0]) != 1) {
		mexErrMsgTxt("NCAMERA must be a scalar");
	}
	else {
		ncam = (int16) mxGetScalar(prhs[0]);
	}

	// return HCAM if camera opened
	// return [] otherwise
	if (pvcam_open(ncam, &hcam)) {
		plhs[0] = mxCreateDoubleScalar((double) hcam);
	}
	else {
		plhs[0] = mxCreateDoubleMatrix(0, 0, mxREAL);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -