| 643 | } |
| 644 | |
| 645 | bool getImageCoordinatesForDepthPixel(int x, int y, int& imageX, int& imageY) |
| 646 | { |
| 647 | if (!g_Depth.IsValid()) |
| 648 | return false; // no depth |
| 649 | |
| 650 | if (!g_Image.IsValid()) |
| 651 | return false; // no image |
| 652 | |
| 653 | if (!g_Depth.IsCapabilitySupported(XN_CAPABILITY_ALTERNATIVE_VIEW_POINT)) |
| 654 | return false; |
| 655 | |
| 656 | XnUInt32 altX; |
| 657 | XnUInt32 altY; |
| 658 | if (XN_STATUS_OK != g_Depth.GetAlternativeViewPointCap().GetPixelCoordinatesInViewPoint(g_Image, x, y, altX, altY)) |
| 659 | return false; |
| 660 | |
| 661 | imageX = (int)altX; |
| 662 | imageY = (int)altY; |
| 663 | return true; |
| 664 | } |
| 665 | |
| 666 | Device* getDevice() |
| 667 | { |
no test coverage detected