APX-3302 User's Manual (OM110000019A)
-36 -
// Check camera type
AcapGetInfo (hDev, INPUT_CH, ACL_SCAN_SYSTEM, 0, &nCamera);)
if
(nCamera == CAM_LINE){
// If the camera is Line sensor, confirm that exposure setting is performed.
AcapGetInfo (hDev, INPUT_CH, ACL_EXP_CYCLE, 0, &nCycle);)
AcapGetInfo (hDev, INPUT_CH, ACL_EXPOSURE, 0, &nScan);)
if
((nCycle == 0) || (nScan == 0)){
printf (
"exposure setting out is injustice ¥n"
);
return
0;
}
}
// Setting for performing DMA to the buffer.
AcapGetInfo (hDev, INPUT_CH, ACL_X_SIZE, 0, &nXSize);)
AcapGetInfo (hDev, INPUT_CH, ACL_Y_SIZE, 0, &nYSize);)
AcapGetInfo (hDev, INPUT_CH, ACL_BOARD_BIT, 0, &nBoardBit);)
AcapSetInfo(hDev, INPUT_CH, ACL_MEM_NUM, 0, 1);
pUserBuffer = (PUCHAR)_aligned_malloc(nXSize * nYSize * (nBoardBit / 8), 16);
ZeroMemory(pUserBuffer, nXSize * nYSize * (nBoardBit / 8));
AcapSetBufferAddress(hDev, INPUT_CH, ACL_IMAGE_PTR, 1, pUserBuffer);
printf (
"in order to suspend an input, please input some keys ¥n"
);
do
{
// Snap
AcapGrabStart(hDev, INPUT_CH, 1);
// Stop capturing
AcapGrabStop(hDev, INPUT_CH);
Sleep(1);
// Dump the data of (x, y) = (100, 100)
nData = pUserBuffer[100 + 100 * nXSize];
printf (
"taking-in number of sheets : %4d data (100, 100) : %3d¥n"
, nLoop++, nData);
}
while
(!kbhit());
printf (
"¥n which suspended the input"
);
// Close device
AcapClose(hDev, INPUT_CH);
// Release the buffer
if
(pUserBuffer != NULL){
_aligned_free(pUserBuffer);
pUserBuffer = NULL;
}
return
0;
}
Summary of Contents for APX-3302
Page 1: ...APX 3302 User s Manual ...