private void OnFrameUpdated(ushort[] pixels, int width, int height) { if (FrameUpdated == null) return; var args = new FrameUpdatedEventArgs(pixels, width, height, HandSessions.Values.AsEnumerable<HandSession>()); FrameUpdated(null, args); }
private void OnFrameUpdated(FrameUpdatedEventArgs e) { if (FrameUpdated == null) return; FrameUpdated(this, e); }
void MotionTrackingClient_FrameUpdated(object sender, FrameUpdatedEventArgs e) { Frame = e.Frame; Factory = _motionTrackingClient.Factory; }
internal void SourceFrameUpdated(FrameUpdatedEventArgs e) { Image sourceImage = null; try { #if DEBUG CountFrames(); #endif if (ProcessDepthImage) { var frame = e.Frame; sourceImage = e.Frame.ToDirectCanvasImage(imageProcessor.Factory); } ushort max = e.Frame.DepthPixels.AsParallel().Max(); ushort min = e.Frame.DepthPixels.AsParallel() .Where(v => v > 100).Min(); imageProcessor.ProcessDepthSessions(sourceImage, deviceDictionary, max, min); OnFrameUpdated(e); } catch (AccessViolationException) { Trace.WriteLine("AccessViolationException - maybe during shutdown?"); if (Application.Current == null) { Trace.WriteLine("Application.Current == null"); } } }
private static void HandPointGenerator_FrameUpdated(object sender, FrameUpdatedEventArgs e) { List<MotionTrackingClient> clientsCopy = new List<MotionTrackingClient>(); lock (clients) { clientsCopy.AddRange(clients); } foreach (var client in clientsCopy) { client.SourceFrameUpdated(e); } }