IsHueSupported = CheckRangeValid(NativeSettings.GetHueRange);
IsSaturationSupported = CheckRangeValid(NativeSettings.GetSaturationRange);
IsSharpnessSupported = CheckRangeValid(NativeSettings.GetSharpnessRange);
+ IsFocusLevelSupported = CheckRangeValid(NativeSettings.GetFocusLevelRange);
IsGainSupported = CheckRangeValid(NativeSettings.GetGainRange);
IsWhiteBalanceTemperatureSupported = CheckRangeValid(NativeSettings.GetWhiteBalanceTemperatureRange);
}
public bool IsSharpnessSupported { get; }
/// <summary>
+ /// Gets the manual focus level feature support state.
+ /// </summary>
+ /// <value>true if supported, otherwise false.</value>
+ /// <since_tizen> 11 </since_tizen>
+ public bool IsFocusLevelSupported { get; }
+
+ /// <summary>
/// Gets the gain feature support state.
/// </summary>
/// <value>true if supported, otherwise false.</value>
}
/// <summary>
+ /// Gets the product ID for given <param name="device"/>.
+ /// </summary>
+ /// <exception cref="ArgumentException">Invalid enumeration.</exception>
+ /// <exception cref="ObjectDisposedException">The CameraDeviceManager already has been disposed.</exception>
+ /// <since_tizen> 11 </since_tizen>
+ public ushort GetProductId(CameraDevice device)
+ {
+ ValidationUtil.ValidateEnum(typeof(CameraDevice), device, nameof(device));
+
+ Native.GetProductId(Handle, out ushort productId).ThrowIfFailed("failed to get product ID");
+
+ return productId;
+ }
+
+ /// <summary>
+ /// Gets the vendor ID for given <param name="device"/>.
+ /// </summary>
+ /// <exception cref="ArgumentException">Invalid enumeration.</exception>
+ /// <exception cref="ObjectDisposedException">The CameraDeviceManager already has been disposed.</exception>
+ /// <since_tizen> 11 </since_tizen>
+ public ushort GetVendorId(CameraDevice device)
+ {
+ ValidationUtil.ValidateEnum(typeof(CameraDevice), device, nameof(device));
+
+ Native.GetVendorId(Handle, out ushort vendorId).ThrowIfFailed("failed to get vendor ID");
+
+ return vendorId;
+ }
+
+ /// <summary>
/// Gets the current camera device information.
/// Retrieves all the supported camera devices and returns its information.
/// </summary>
private readonly Range? _zoomRange;
private readonly Range? _saturationRange;
private readonly Range? _sharpnessRange;
+ private readonly Range? _focusLevelRange;
private readonly Range? _gainRange;
private readonly Range? _whitebalanceTemperatureRange;
_zoomRange = GetRange(Native.GetZoomRange);
_saturationRange = GetRange(Native.GetSaturationRange);
_sharpnessRange = GetRange(Native.GetSharpnessRange);
+ _focusLevelRange = GetRange(Native.GetFocusLevelRange);
_gainRange = GetRange(Native.GetGainRange);
_whitebalanceTemperatureRange = GetRange(Native.GetWhiteBalanceTemperatureRange);
}
}
#endregion sharpness
+ #region focus level
+ /// <summary>
+ /// Gets or sets the camera manual focus level.
+ /// </summary>
+ /// <remark>If user set this value for manual focus, auto focusing will be stopped.</remark>
+ /// <since_tizen> 11 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera has already been disposed. </exception>
+ public int FocusLevel
+ {
+ get
+ {
+ Native.GetFocusLevel(_camera.GetHandle(), out int val).
+ ThrowIfFailed("Failed to get camera manual focus level.");
+
+ return val;
+ }
+ set
+ {
+ Native.SetFocusLevel(_camera.GetHandle(), value).
+ ThrowIfFailed("Failed to set camera manual focus level.");
+ }
+ }
+
+ /// <summary>
+ /// Gets the available manual focus level 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">Focus level is not supported.</exception>
+ public Range FocusLevelRange
+ {
+ get
+ {
+ if (!_focusLevelRange.HasValue)
+ {
+ throw new NotSupportedException("Focus level is not supported.");
+ }
+
+ return _focusLevelRange.Value;
+ }
+ }
+ #endregion focus level
+
#region gain
/// <summary>
/// Gets or sets the camera gain value.
[DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_remove_device_connection_changed_cb")]
internal static extern CameraError UnsetDeviceConnectionChangedCallback(IntPtr handle, int id);
+ [DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_get_product_id")]
+ internal static extern CameraError GetProductId(IntPtr handle, out ushort id);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_device_manager_get_vendor_id")]
+ internal static extern CameraError GetVendorId(IntPtr handle, out ushort id);
+
[NativeStruct("camera_device_s", Include="camera.h", PkgConfig="capi-media-camera")]
[StructLayout(LayoutKind.Sequential)]
internal struct CameraDeviceStruct
[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_focus_level")]
+ internal static extern CameraError SetFocusLevel(IntPtr handle, int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_focus_level")]
+ internal static extern CameraError GetFocusLevel(IntPtr handle, out int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_focus_level_range")]
+ internal static extern CameraError GetFocusLevelRange(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);