-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGetMaxGain.cpp
36 lines (27 loc) · 898 Bytes
/
GetMaxGain.cpp
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
/*
* This file gets the max gain on the ThorLabs camera.
* By Matthew K. Daddysman 10/31/2014
*/
#include <windows.h>
#include <stdlib.h>
#include "mex.h"
#include "matrix.h"
#include "uc480.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
if(nlhs != 1)
mexErrMsgTxt("One output!");
if(nrhs != 1)
mexErrMsgTxt("There must be one input: hCam.");
HCAM phCam = 0;
INT result;
double *gainptr = (double *)mxCalloc(1,sizeof(double));
INT32_T *rhd = (INT32_T *)mxGetData(prhs[0]);
phCam = (HCAM)rhd[0];
result = is_SetHWGainFactor(phCam,IS_INQUIRE_MASTER_GAIN_FACTOR,100);
*gainptr = result/100;
plhs[0] = mxCreateNumericMatrix(0,0,mxDOUBLE_CLASS,mxREAL);
mxSetData(plhs[0],gainptr);
mxSetM(plhs[0],1);
mxSetN(plhs[0],1);
}