IsPanSupported = CheckRangeValid(NativeSettings.GetPanRange);
IsTiltSupported = CheckRangeValid(NativeSettings.GetTiltRange);
IsHueSupported = CheckRangeValid(NativeSettings.GetHueRange);
+ IsSaturationSupported = CheckRangeValid(NativeSettings.GetSaturationRange);
+ IsSharpnessSupported = CheckRangeValid(NativeSettings.GetSharpnessRange);
+ IsGainSupported = CheckRangeValid(NativeSettings.GetGainRange);
+ IsWhiteBalanceTemperatureSupported = CheckRangeValid(NativeSettings.GetWhiteBalanceTemperatureRange);
}
private bool IsFeatureSupported(IsSupportedDelegate func)
public bool IsHueSupported { get; }
/// <summary>
+ /// Gets the saturation feature support state.
+ /// </summary>
+ /// <value>true if supported, otherwise false.</value>
+ /// <since_tizen> 11 </since_tizen>
+ public bool IsSaturationSupported { get; }
+
+ /// <summary>
+ /// Gets the sharpness feature support state.
+ /// </summary>
+ /// <value>true if supported, otherwise false.</value>
+ /// <since_tizen> 11 </since_tizen>
+ public bool IsSharpnessSupported { get; }
+
+ /// <summary>
+ /// Gets the gain feature support state.
+ /// </summary>
+ /// <value>true if supported, otherwise false.</value>
+ /// <since_tizen> 11 </since_tizen>
+ public bool IsGainSupported { get; }
+
+ /// <summary>
+ /// Gets the white balance temperature feature support state.
+ /// </summary>
+ /// <value>true if supported, otherwise false.</value>
+ /// <since_tizen> 11 </since_tizen>
+ public bool IsWhiteBalanceTemperatureSupported { get; }
+
+ /// <summary>
/// Retrieves all the preview resolutions supported by the camera.
/// </summary>
/// <since_tizen> 4 </since_tizen>
private readonly Range? _panRange;
private readonly Range? _tiltRange;
private readonly Range? _zoomRange;
+ private readonly Range? _saturationRange;
+ private readonly Range? _sharpnessRange;
+ private readonly Range? _gainRange;
+ private readonly Range? _whitebalanceTemperatureRange;
internal CameraSettings(Camera camera)
{
_panRange = GetRange(Native.GetPanRange);
_tiltRange = GetRange(Native.GetTiltRange);
_zoomRange = GetRange(Native.GetZoomRange);
+ _saturationRange = GetRange(Native.GetSaturationRange);
+ _sharpnessRange = GetRange(Native.GetSharpnessRange);
+ _gainRange = GetRange(Native.GetGainRange);
+ _whitebalanceTemperatureRange = GetRange(Native.GetWhiteBalanceTemperatureRange);
}
private delegate CameraError GetRangeDelegate(IntPtr handle, out int min, out int max);
}
/// <summary>
- /// Gets the available contrast level.
+ /// Gets the available contrast value range.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
}
/// <summary>
- /// Gets the available hue level.
+ /// Gets the available hue value range.
/// </summary>
/// <since_tizen> 5 </since_tizen>
/// <remarks>
}
/// <summary>
- /// Gets the available brightness level.
+ /// Gets the available brightness value range.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
}
/// <summary>
- /// Gets the available exposure value.
+ /// Gets the available exposure value range.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
}
#endregion Exposure
+ #region saturation
+ /// <summary>
+ /// Gets or sets the camera saturation value.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public int Saturation
+ {
+ get
+ {
+ Native.GetSaturation(_camera.GetHandle(), out int val).
+ ThrowIfFailed("Failed to get camera saturation value");
+
+ return val;
+ }
+ set
+ {
+ Native.SetSaturation(_camera.GetHandle(), value).
+ ThrowIfFailed("Failed to set camera saturation value.");
+ }
+ }
+
+ /// <summary>
+ /// Gets the available saturation value range.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <remarks>
+ /// If the minimum value is greater than the maximum value, it means this feature is not supported.
+ /// </remarks>
+ /// <exception cref="NotSupportedException">Saturation is not supported.</exception>
+ public Range SaturationRange
+ {
+ get
+ {
+ if (!_saturationRange.HasValue)
+ {
+ throw new NotSupportedException("Saturation is not supported.");
+ }
+
+ return _saturationRange.Value;
+ }
+ }
+ #endregion saturation
+
+ #region sharpness
+ /// <summary>
+ /// Gets or sets the camera sharpness value.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public int Sharpness
+ {
+ get
+ {
+ Native.GetSharpness(_camera.GetHandle(), out int val).
+ ThrowIfFailed("Failed to get camera sharpness value");
+
+ return val;
+ }
+ set
+ {
+ Native.SetSharpness(_camera.GetHandle(), value).
+ ThrowIfFailed("Failed to set camera sharpness value.");
+ }
+ }
+
+ /// <summary>
+ /// Gets the available sharpness value range.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <remarks>
+ /// If the minimum value is greater than the maximum value, it means this feature is not supported.
+ /// </remarks>
+ /// <exception cref="NotSupportedException">Sharpness is not supported.</exception>
+ public Range SharpnessRange
+ {
+ get
+ {
+ if (!_sharpnessRange.HasValue)
+ {
+ throw new NotSupportedException("Sharpness is not supported.");
+ }
+
+ return _sharpnessRange.Value;
+ }
+ }
+ #endregion sharpness
+
+ #region gain
+ /// <summary>
+ /// Gets or sets the camera gain value.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public int Gain
+ {
+ get
+ {
+ Native.GetGain(_camera.GetHandle(), out int val).
+ ThrowIfFailed("Failed to get camera gain value");
+
+ return val;
+ }
+ set
+ {
+ Native.SetGain(_camera.GetHandle(), value).
+ ThrowIfFailed("Failed to set camera gain value.");
+ }
+ }
+
+ /// <summary>
+ /// Gets the available gain value range.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <remarks>
+ /// If the minimum value is greater than the maximum value, it means this feature is not supported.
+ /// </remarks>
+ /// <exception cref="NotSupportedException">Gain is not supported.</exception>
+ public Range GainRange
+ {
+ get
+ {
+ if (!_gainRange.HasValue)
+ {
+ throw new NotSupportedException("Gain is not supported.");
+ }
+
+ return _gainRange.Value;
+ }
+ }
+
+ /// <summary>
+ /// Gets the camera gain step value.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public int GainStep
+ {
+ get
+ {
+ Native.GetGainStep(_camera.GetHandle(), out int val).
+ ThrowIfFailed("Failed to get camera gain step value");
+
+ return val;
+ }
+ }
+ #endregion gain
+
+ #region whitebalanceTemperature
+ /// <summary>
+ /// Gets or sets the camera white balance temperature value.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public int WhiteBalanceTemperature
+ {
+ get
+ {
+ Native.GetWhiteBalanceTemperature(_camera.GetHandle(), out int val).
+ ThrowIfFailed("Failed to get camera white balance temperature value");
+
+ return val;
+ }
+ set
+ {
+ Native.SetWhitebalanceTemperature(_camera.GetHandle(), value).
+ ThrowIfFailed("Failed to set camera white balance temperature value.");
+ }
+ }
+
+ /// <summary>
+ /// Gets the available camera white balance temperature value range.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <remarks>
+ /// If the minimum value is greater than the maximum value, it means this feature is not supported.
+ /// </remarks>
+ /// <exception cref="NotSupportedException">WhiteBalanceTemperatureRange is not supported.</exception>
+ public Range WhiteBalanceTemperatureRange
+ {
+ get
+ {
+ if (!_whitebalanceTemperatureRange.HasValue)
+ {
+ throw new NotSupportedException("WhiteBalanceTemperatureRange is not supported.");
+ }
+
+ return _whitebalanceTemperatureRange.Value;
+ }
+ }
+
+ /// <summary>
+ /// Gets the camera white balance temperature step value.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public int WhiteBalanceTemperatureStep
+ {
+ get
+ {
+ Native.GetWhiteBalanceTemperatureStep(_camera.GetHandle(), out int val).
+ ThrowIfFailed("Failed to get camera white balance temperature step value");
+
+ return val;
+ }
+ }
+ #endregion whitebalanceTemperature
+
#region Zoom
/// <summary>
/// The zoom level.
}
/// <summary>
- /// Gets the available zoom level.
+ /// Gets the available zoom value range.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
[DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_whitebalance")]
internal static extern CameraError GetWhiteBalance(IntPtr handle, out CameraWhiteBalance level);
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_whitebalance_temperature")]
+ internal static extern CameraError SetWhitebalanceTemperature(IntPtr handle, int temperature);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_whitebalance_temperature")]
+ internal static extern CameraError GetWhiteBalanceTemperature(IntPtr handle, out int temperature);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_whitebalance_temperature_step")]
+ internal static extern CameraError GetWhiteBalanceTemperatureStep(IntPtr handle, out int step);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_whitebalance_temperature_range")]
+ internal static extern CameraError GetWhiteBalanceTemperatureRange(IntPtr handle, out int min, out int max);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_saturation")]
+ internal static extern CameraError SetSaturation(IntPtr handle, int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_saturation")]
+ internal static extern CameraError GetSaturation(IntPtr handle, out int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_saturation_range")]
+ internal static extern CameraError GetSaturationRange(IntPtr handle, out int min, out int max);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_sharpness")]
+ internal static extern CameraError SetSharpness(IntPtr handle, int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_sharpness")]
+ internal static extern CameraError GetSharpness(IntPtr handle, out int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_sharpness_range")]
+ internal static extern CameraError GetSharpnessRange(IntPtr handle, out int min, out int max);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_gain")]
+ internal static extern CameraError SetGain(IntPtr handle, int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_gain")]
+ internal static extern CameraError GetGain(IntPtr handle, out int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_gain_step")]
+ internal static extern CameraError GetGainStep(IntPtr handle, out int step);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_gain_range")]
+ internal static extern CameraError GetGainRange(IntPtr handle, out int min, out int max);
+
[DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_effect")]
internal static extern CameraError SetEffect(IntPtr handle, CameraEffectMode mode);