24
if(!memcpy(start_of_pr, hpAcquireBuf,
bytes_to_copy))
{
GlobalUnlock(hpAcquireBuf);
GlobalFree(hAcquireBuf);
OlFgDestroyFrame( CurDevInfo.DevId,
FrameId);
(void)
OlImgCloseDevice(CurDevInfo.DevId);
mexErrMsgTxt("Cannot copy.\n");
}
GlobalUnlock(hpAcquireBuf);
GlobalFree(hAcquireBuf);
OlFgDestroyFrame( CurDevInfo.DevId, FrameId);
}
}
//free allocated memory
BOOL freeMemory()
{
GlobalUnlock(hpAcquireBuf);
GlobalFree(hAcquireBuf);
OlFgDestroyFrame( CurDevInfo.DevId, FrameId);
(void) OlImgCloseDevice(CurDevInfo.DevId);
mexPrintf("Camera closed.\n");
}
BOOL SelectDevice(int index)
{
int iCount = 0;
OLT_APISTATUS Status = OLC_STS_NORMAL;
HGLOBAL hDevInfoList = NULL;
LPOLT_IMGDEVINFO lpDevInfoList = NULL;
int i = 0;
/* How many aliases do we have */
if ( (Status = OlImgGetDeviceCount(&iCount)) != OLC_STS_NORMAL )
{
FILE *file_out;
file_out = fopen ("ERROR4.txt", "w");
fprintf(file_out, "OlImgGetDeviceCount failed (status =
%#08lx).", Status);
return FALSE;
}
/* Anything? */
if ( !iCount )
return TRUE;
Comentarios a estos manuales