MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / getImageCoordinatesForDepthPixel

Function getImageCoordinatesForDepthPixel

Samples/NiViewer/Device.cpp:645–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643}
644
645bool 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
666Device* getDevice()
667{

Callers 1

drawFrameFunction · 0.85

Calls 4

IsValidMethod · 0.45
IsCapabilitySupportedMethod · 0.45

Tested by

no test coverage detected