kinect/codes/Azure-Kinect-Samples/body-tracking-samples/csharp_3d_viewer/VisualizerData.cs

42 lines
791 B
C#
Raw Normal View History

2024-03-06 18:05:53 +00:00
using Microsoft.Azure.Kinect.BodyTracking;
using System;
namespace Csharp_3d_viewer
{
public class VisualizerData : IDisposable
{
private Frame frame;
public Frame Frame
{
set
{
lock (this)
{
frame?.Dispose();
frame = value;
}
}
}
public Frame TakeFrameWithOwnership()
{
lock (this)
{
var result = frame;
frame = null;
return result;
}
}
public void Dispose()
{
lock (this)
{
frame?.Dispose();
frame = null;
}
}
}
}