| 42 | using namespace xn; |
| 43 | |
| 44 | int main() |
| 45 | { |
| 46 | XnStatus nRetVal = XN_STATUS_OK; |
| 47 | Context context; |
| 48 | |
| 49 | nRetVal = context.Init(); |
| 50 | CHECK_RC(nRetVal, "Initialize context"); |
| 51 | |
| 52 | DepthGenerator depth; |
| 53 | nRetVal = depth.Create(context); |
| 54 | CHECK_RC(nRetVal, "Create depth generator"); |
| 55 | |
| 56 | nRetVal = context.StartGeneratingAll(); |
| 57 | CHECK_RC(nRetVal, "StartGeneratingAll"); |
| 58 | |
| 59 | DepthMetaData depthMD; |
| 60 | while (!xnOSWasKeyboardHit()) |
| 61 | { |
| 62 | nRetVal = context.WaitOneUpdateAll(depth); |
| 63 | if (nRetVal != XN_STATUS_OK) |
| 64 | { |
| 65 | printf("UpdateData failed: %s\n", xnGetStatusString(nRetVal)); |
| 66 | continue; |
| 67 | } |
| 68 | |
| 69 | depth.GetMetaData(depthMD); |
| 70 | printf("Frame %d Middle point is: %u.\n", depthMD.FrameID(), depthMD(depthMD.XRes() / 2, depthMD.YRes() / 2)); |
| 71 | } |
| 72 | |
| 73 | depth.Release(); |
| 74 | context.Release(); |
| 75 | |
| 76 | return 0; |
| 77 | } |
nothing calls this directly
no test coverage detected