コード例 #1
0
        /// <summary>
        /// Updates list of depth modes that this camera has.
        /// </summary>
        private void UpdateDepthModes()
        {
            List <DepthFrameMode> modes = new List <DepthFrameMode>();

            // Get number of modes
            int numModes = KinectNative.freenect_get_depth_mode_count(this.parentDevice.devicePointer);

            // Go through modes
            for (int i = 0; i < numModes; i++)
            {
                DepthFrameMode mode = (DepthFrameMode)FrameMode.FromInterop(KinectNative.freenect_get_depth_mode(i), FrameMode.FrameModeType.DepthFormat);
                if (mode != null)
                {
                    modes.Add(mode);
                }
            }

            // All done
            this.Modes = modes.ToArray();
        }
 /// <summary>
 /// Finds a mode, given a format and resolution.
 /// </summary>
 /// <param name="format">
 /// Depth format for the mode
 /// </param>
 /// <param name="resolution">
 /// Resolution for the mode
 /// </param>
 /// <returns>
 /// Mode with the format/resolution combo. Null if the combination is invalid.
 /// </returns>
 public static DepthFrameMode Find(DepthFormat format, Resolution resolution)
 {
     return((DepthFrameMode)FrameMode.FromInterop(KinectNative.freenect_find_depth_mode(resolution, format), FrameMode.FrameModeType.DepthFormat));
 }
コード例 #3
0
 /// <summary>
 /// Finds a mode, given a format and resolution.
 /// </summary>
 /// <param name="format">
 /// Video format for the mode
 /// </param>
 /// <param name="resolution">
 /// Resolution for the mode
 /// </param>
 /// <returns>
 /// Mode with the format/resolution combo. Null if the combination is invalid.
 /// </returns>
 public static VideoFrameMode Find(VideoFormat format, Resolution resolution)
 {
     return((VideoFrameMode)FrameMode.FromInterop(KinectNative.freenect_find_video_mode(resolution, format), FrameMode.FrameModeType.VideoFormat));
 }