Esempio n. 1
0
 /// <summary>Gets the Azure Kinect color sensor control capabilities.</summary>
 /// <param name="command">Color sensor control command.</param>
 /// <param name="supportsAuto">Output: whether the color sensor's control support auto mode or not. <see langword="true"/> if it supports auto mode, otherwise <see langword="false"/>.</param>
 /// <param name="minValue">Output: the color sensor's control minimum value of <paramref name="command"/>.</param>
 /// <param name="maxValue">Output: the color sensor's control maximum value of <paramref name="command"/>.</param>
 /// <param name="valueStep">Output: the color sensor's control step value of <paramref name="command"/>.</param>
 /// <param name="defaultValue">Output: the color sensor's control default value of <paramref name="command"/>.</param>
 /// <param name="defaultMode">Output: the color sensor's control default mode of <paramref name="command"/>.</param>
 /// <exception cref="ObjectDisposedException">This method cannot be called for disposed object.</exception>
 /// <exception cref="DeviceConnectionLostException">Connection with Azure Kinect device has been lost.</exception>
 /// <exception cref="InvalidOperationException">Not supported <paramref name="command"/>.</exception>
 public void GetColorControlCapabilities(ColorControlCommand command,
                                         out bool supportsAuto, out int minValue, out int maxValue, out int valueStep,
                                         out int defaultValue, out ColorControlMode defaultMode)
 => CheckResult(
     NativeApi.DeviceGetColorControlCapabilities(handle.ValueNotDisposed, command,
                                                 out supportsAuto, out minValue, out maxValue, out valueStep,
                                                 out defaultValue, out defaultMode),
     "Not supported command: " + command);
Esempio n. 2
0
        /// <summary>
        /// Sets the Azure Kinect color sensor control value.
        /// </summary>
        /// <param name="command">Color sensor control command.</param>
        /// <param name="mode">The mode of the color control option.</param>
        /// <param name="value">The value of the color control option.</param>
        public void SetColorControl(ColorControlCommand command, ColorControlMode mode, int value)
        {
            lock (this)
            {
                if (this.disposedValue)
                {
                    throw new ObjectDisposedException(nameof(Device));
                }

                AzureKinectException.ThrowIfNotSuccess(() => NativeMethods.k4a_device_set_color_control(this.handle, command, mode, value));
            }
        }
Esempio n. 3
0
        public Int32 GetColorControl(ColorControlCommand command, out ColorControlMode mode)
        {
            lock (this)
            {
                if (disposedValue)
                {
                    throw new ObjectDisposedException(nameof(Device));
                }

                AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_get_color_control(handle, command, out mode, out int value));
                return(value);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Get the Azure Kinect color sensor control value.
        /// </summary>
        /// <param name="command">Color sensor control command.</param>
        /// <param name="mode">The mode of the color control option.</param>
        /// <returns>The value of the color control option.</returns>
        public int GetColorControl(ColorControlCommand command, out ColorControlMode mode)
        {
            lock (this)
            {
                if (this.disposedValue)
                {
                    throw new ObjectDisposedException(nameof(Device));
                }

                using (LoggingTracer tracer = new LoggingTracer())
                {
                    AzureKinectException.ThrowIfNotSuccess(tracer, NativeMethods.k4a_device_get_color_control(this.handle, command, out mode, out int value));
                    return(value);
                }
            }
        }
 public static extern k4a_result_t k4a_device_get_color_control(k4a_device_t device_handle, ColorControlCommand command, out ColorControlMode mode, out Int32 value);
Esempio n. 6
0
 /// <summary>Gets the Azure Kinect color sensor control value.</summary>
 /// <param name="command">Color sensor control command.</param>
 /// <param name="mode">This mode represents whether the command is in automatic or manual mode.</param>
 /// <param name="value">This value is always written, but is only valid when the <paramref name="mode"/> returned is <see cref="ColorControlMode.Manual"/> for the current <paramref name="command"/>.</param>
 /// <remarks><para>
 /// Each control command may be set to manual or automatic. See the definition of <see cref="ColorControlCommand"/> on
 /// how to interpret the <paramref name="value"/> for each command.
 /// </para><para>
 /// Some control commands are only supported in manual mode. When a command is in automatic mode, the <paramref name="value"/> for
 /// that command is not valid.
 /// </para><para>
 /// Control values set on a device are reset only when the device is power cycled. The device will retain the
 /// settings even if the device is disposed or the application is restarted.
 /// </para></remarks>
 /// <exception cref="ObjectDisposedException">This method cannot be called for disposed object.</exception>
 /// <exception cref="DeviceConnectionLostException">Connection with Azure Kinect device has been lost.</exception>
 /// <exception cref="InvalidOperationException">Not supported <paramref name="command"/>.</exception>
 public void GetColorControl(ColorControlCommand command, out ColorControlMode mode, out int value)
 => CheckResult(
     NativeApi.DeviceGetColorControl(handle.ValueNotDisposed, command, out mode, out value),
     "Not supported command: " + command);
Esempio n. 7
0
 /// <summary>Set the Azure Kinect color sensor control value.</summary>
 /// <param name="command">Color sensor control command.</param>
 /// <param name="mode">Color sensor control mode to set. This mode represents whether the command is in automatic or manual mode.</param>
 /// <param name="value">
 /// Value to set the color sensor's control to. The value is only valid if <paramref name="mode"/>
 /// is set to <see cref="ColorControlMode.Manual"/>, and is otherwise ignored.
 /// </param>
 /// <returns><see langword="true"/> if the value was successfully set, <see langword="false"/> -  otherwise.</returns>
 /// <remarks><para>
 /// Each control command may be set to manual or automatic. See the definition of <see cref="ColorControlCommand"/> on how
 /// to interpret the <paramref name="value"/> for each command.
 /// </para><para>
 /// Some control commands are only supported in manual mode. When a command is in automatic mode, the <paramref name="value"/> for that
 /// command is not valid.
 /// </para><para>
 /// Control values set on a device are reset only when the device is power cycled. The device will retain the settings
 /// even if the device is disposed or the application is restarted.
 /// </para></remarks>
 /// <exception cref="ObjectDisposedException">This method cannot be called for disposed object.</exception>
 public bool TrySetColorControl(ColorControlCommand command, ColorControlMode mode, int value)
 => NativeApi.DeviceSetColorControl(handle.ValueNotDisposed, command, mode, value) == NativeCallResults.Result.Succeeded;
 public static extern k4a_result_t k4a_device_set_color_control(k4a_device_t device_handle, ColorControlCommand command, ColorControlMode mode, int value);