private bool aquireBodyDataAndBuffers(
            BodyFrame bodyFrame, DepthFrame depthFrame, BodyIndexFrame bodyIndexFrame,
            out Body body, out KinectBuffer depthBuffer, out KinectBuffer bodyIndexBuffer)
        {
            depthBuffer     = null;
            bodyIndexBuffer = null;

            body = getActiveBody(bodyFrame);
            if (body == null)
            {
                return(false);
            }

            depthBuffer = depthFrame.LockImageBuffer();
            var width  = depthFrameDescription.Width;
            var height = depthFrameDescription.Height;

            if (depthBuffer == null ||
                (width * height) != (depthBuffer.Size / this.depthFrameDescription.BytesPerPixel))
            {
                return(false);
            }

            bodyIndexBuffer = bodyIndexFrame.LockImageBuffer();
            if (bodyIndexBuffer == null || bodyIndexBuffer.Size * 2 != depthBuffer.Size)
            {
                depthBuffer.Dispose();
                return(false);
            }
            return(true);
        }
예제 #2
0
 public void Dispose() => buffer.Dispose();
예제 #3
0
 protected override void Dispose(bool disposing)
 {
     buffer.Dispose();
 }