/// <summary> /// Sets the direct access buffer for the DepthCamera. /// </summary> /// <param name="ptr"> /// Pointer to the direct access data buffer for the DepthCamera. /// </param> protected override void SetDataBuffer(IntPtr ptr) { // Save data buffer this.dataBuffer = ptr; // Tell the kinect library about it KinectNative.freenect_set_depth_buffer(this.parentDevice.devicePointer, ptr); // update depth map this.UpdateNextFrameDepthMap(); }
/// <summary> /// Updates the next frame depth map that's waiting for data with any state changes /// </summary> protected void UpdateNextFrameDepthMap() { if (this.DataBuffer == IntPtr.Zero) { // have to set our own buffer as the depth buffer this.nextFrameDepthMap = new DepthMap(this.DataFormat); KinectNative.freenect_set_depth_buffer(this.parentDevice.devicePointer, this.nextFrameDepthMap.DataPointer); } else { // already have a buffer from user this.nextFrameDepthMap = new DepthMap(this.DataFormat, this.DataBuffer); } }
/// <summary> /// Updates the next frame depth map that's waiting for data with any state changes /// </summary> protected void UpdateNextFrameDepthMap() { if (this.DataBuffer == IntPtr.Zero) { // have to set our own buffer as the depth buffer this.nextFrameData = new DepthMap(this.Mode); } else { // already have a buffer from user this.nextFrameData = new DepthMap(this.Mode, this.DataBuffer); } // Set new buffer at library level; KinectNative.freenect_set_depth_buffer(this.parentDevice.devicePointer, this.nextFrameData.DataPointer); }