Esempio n. 1
0
        /// <summary>
        /// Sets the DepthCameras's data format. Support function for DepthCamera.DataFormat
        /// </summary>
        /// <param name="format">
        /// A <see cref="DepthCamera.DataFormatOptions"/>
        /// </param>
        private void SetDataFormat(DepthCamera.DataFormatOption format)
        {
            // change depth map that's waiting cause format has changed
            this.UpdateNextFrameDepthMap();

            int result = KinectNative.freenect_set_depth_format(this.parentDevice.devicePointer, format);

            if (result != 0)
            {
                throw new Exception("Could not switch to depth format " + format + ". Error Code: " + result);
            }
            this.dataFormat = format;
        }