Matrox GatorEye Series Installation And Technical Reference page 36

Table of Contents

Advertisement

36 Chapter 3: Matrox GatorEye User Guide
Laser range control example (Continued)
// This callback function draws the location of the first laser line.
MIL_INT MFTYPE GrabCallbackFn(MIL_INT HookType, MIL_ID HookId, void MPTYPE *UHookDataPtr)
{
HookDataStruct *HookDataPtr = (HookDataStruct *)UHookDataPtr;
MIL_ID ModifiedBufId;
// Retrieves the MIL_ID of the grabbed buffer.
MdigGetHookInfo(HookId, M_MODIFIED_BUFFER+M_BUFFER_ID, &ModifiedBufId);
// Copies raw data to another buffer so grab buffer can be re-used while
// processing data.
MbufCopy(ModifiedBufId, HookDataPtr->PosAndI_MILImageBuf);
// Draws the location in which the laser line was found.
MbufClear(HookDataPtr->Disp_MilImageBuf, M_BLACK);
for (unsigned i=0; i < NbLaserLines; i++)
{
MimDraw(M_DEFAULT, HookDataPtr->Pos_MilImageBuf, HookDataPtr->I_MilImageBuf,
HookDataPtr->Disp_MilImageBuf, M_DRAW_PEAKS+M_1D_COLUMNS+M_LINES,
(MIL_DOUBLE)i, 1, M_FIXED_POINT+ExtractionFixedPoint);
}
return 0;
}

Advertisement

Table of Contents
loading

Table of Contents