APX-3302 User's Manual (OM110000019A)
-38 -
// ch1: 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);)
for
(nCount= 0; nCount < 4; +){
pUserBuffer[nCount] =
(PUCHAR)_aligned_malloc(nXSize * nYSize * (nBoardBit / 8), 16);
ZeroMemory(pUserBuffer[nCount], nXSize * nYSize * (nBoardBit / 8));
// Set nMemnum as negative value, for suspending reflection of setting at end.
AcapSetBufferAddress(hDev, INPUT_CH, ACL_IMAGE_PTR,
( 1)*(-1), &pUserBuffer[nCount][0]);
}
// Reflect configuration parameter
AcapReflectParam(hDev, INPUT_CH);
// Register callback function
// ch1: Register ACL_INT_FRAMEEND (Frame decision interruption)
dwEventMask = ACL_INT_FRAMEEND;
AcapRegistCallback(hDev, INPUT_CH, dwEventMask, GrabCallbackFunc);
// Grab start
printf (
"in order to suspend an input, please input some keys ¥n"
);
AcapGrabStart(hDev, INPUT_CH, 0);
do
{
Sleep(1);
}
while
(!kbhit());
// Grab stop
AcapGrabStop(hDev, INPUT_CH);
printf (
"¥n which suspended the input"
);
// Close device
AcapClose(hDev, INPUT_CH);
// Release the buffer
for
(nCount = 0; nCount < 4; +){
if
(pUserBuffer[nCount] != NULL){
_aligned_free(pUserBuffer[nCount]);
pUserBuffer[nCount] = NULL;
}
}
return
0;
}
//callback function
void
CALLBACK GrabCallbackFunc(
int
nChannel, DWORD dwEvent,
int
nParam1,
int
nParam2)
{
int
nIndex;
int
nData;
switch(dwEvent){
case
ACL_INT_FRAMEEND:
//Processing of Frame decision interruption
// Dump the data of (x, y) = (100, 100)
nData = pUserBuffer[nParam2-1][100 + 100 * nXSize];
printf (
"taking-in number of sheets : %4d data (100, 100) : %3d¥n"
,
nParam1, nData);
break
;
}
}
Summary of Contents for APX-3302
Page 1: ...APX 3302 User s Manual ...