77 / 160
Copyright © 2016-2018 TOSHIBA TELI CORPORATION, All Rights Reserved.
http://www.toshiba-teli.co.jp/en/index.htm
D4259344C
// 1.Select an Image Buffer mode
uint32_t dat = 1;
Cam_WriteReg(s_hCam, 0x20307C, 1, &dat);
// 2.Open and Start image stream.
// 2.1.Set Trigger mode
SetCamTriggerMode(s_hCam, true);
SetCamTriggerSource(s_hCam, CAM_TRIGGER_SOFTWARE);
// 2.2.Open Stream
s_hStrmEvt = CreateEvent(NULL, FALSE, FALSE, NULL);
Strm_OpenSimple(s_hCam, &s_hStrm, &s_uiImgBufSize, s_hStrmEvt);
s_pucImgBuf = (uint8_t *)VirtualAlloc(NULL, s_uiImgBufSize,
MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
// 2.3.Stream Start
Strm_Start(s_hStrm);
// 2.4.Execute Software Trigger
ExecuteCamSoftwareTrigger(s_hCam);
// 3.Read the number of frames in Image Buffer.
uint32_t count = 0;
while(count==0)
{
Cam_ReadReg(s_hCam, 0x20309C, 1, &count);
}
// 4.Read Image from Image Buffer. AcquisitionCommand = 10 : Image Buffer Read
dat = 10;
Cam_WriteReg(s_hCam, 0x20303C, 1, &dat);
// 5.Receive Image from Image Buffer
uint32_t uiSize = s_uiImgBufSize;
WaitForSingleObject(s_hStrmEvt, 1000);
Strm_ReadCurrentImage(s_hStrm, s_pucImgBuf, &uiSize, NULL);
// 6.Stop and Close image stream.
// 6.1.Stream Stop
Strm_Stop(s_hStrm);
// 6.2.Close Stream
Strm_Close(s_hStrm);
CloseHandle(s_hStrmEvt);
VirtualFree(s_pucImgBuf, 0, MEM_RELEASE);
Please refer to [Camera functions] in [TeliCamAPI Library manual] for more detail.
● Note
- The maximum number of frames storable depends on the image size. (maximum 64MByte.)
- The number of frames to be transferred by ‘ImageBufferRead’ command is determined by
‘AcquisitionFrameCount’.
- Changing ‘ImageBufferMode’ register value is invalid during image stream data output.