/// It also notifies you when a significant picture parameter changes, (For example, focus).
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
public class Camera : IDisposable, IDisplayable<CameraError>
{
private IntPtr _handle = IntPtr.Zero;
/// <summary>
/// Initializes a new instance of the <see cref="Camera"/> class.
/// </summary>
- /// <feature>http://tizen.org/feature/camera</feature>
- /// <since_tizen> 3 </since_tizen>
/// <param name="device">The camera device to access.</param>
+ /// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
public Camera(CameraDevice device)
{
if (!Features.IsSupported(CameraFeatures.Camera))
/// Gets the native handle of the camera.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
public IntPtr Handle => GetHandle();
internal IntPtr GetHandle()
/// Releases all resources used by the camera.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
public void Dispose()
{
ReplaceDisplay(null);
/// <summary>
/// Changes the camera device.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <param name="device">The hardware camera to access.</param>
+ /// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <remarks>
/// If display reuse is set using <see cref="DisplayReuseHint"/>
/// before stopping the preview, the display will be reused and last frame on the display
/// <summary>
/// Gets the device state.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <param name="device">The device to get the state.</param>
/// <returns>Returns the state of the camera device.</returns>
+ /// <since_tizen> 4 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
/// <summary>
/// Gets the flash state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <param name="device">The device to get the state.</param>
/// <returns>Returns the flash state of the camera device.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
/// The camera must be in the <see cref="CameraState.Created"/> or the <see cref="CameraState.Captured"/> state.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <privilege>
- /// http://tizen.org/privilege/camera
- /// </privilege>
+ /// <privilege> http://tizen.org/privilege/camera </privilege>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
/// The camera must be in the <see cref="CameraState.Preview"/> state.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <privilege>
- /// http://tizen.org/privilege/camera
- /// </privilege>
+ /// <privilege> http://tizen.org/privilege/camera </privilege>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
/// The camera must be in the <see cref="CameraState.Preview"/> state.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <privilege>
- /// http://tizen.org/privilege/camera
- /// </privilege>
+ /// <privilege> http://tizen.org/privilege/camera </privilege>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <remarks>
/// This function causes the transition of the camera state from capturing to captured
/// automatically and the corresponding EventHandlers will be invoked.
/// and for completed using <see cref="CaptureCompleted"/> before calling this method.
/// The camera must be in the <see cref="CameraState.Preview"/> state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <privilege>
- /// http://tizen.org/privilege/camera
- /// </privilege>
/// <param name="count">The number of still images.</param>
/// <param name="interval">The interval of the capture(milliseconds).</param>
/// <param name="cancellationToken">The cancellation token to cancel capturing.</param>
/// <seealso cref="CancellationToken"/>
+ /// <since_tizen> 3 </since_tizen>
+ /// <privilege> http://tizen.org/privilege/camera </privilege>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <remarks>
/// If this is not supported, zero shutter lag occurs. The capture resolution could be
/// changed to the preview resolution. This function causes the transition of the camera state
/// Starts camera auto-focusing, asynchronously.
/// The camera must be in the <see cref="CameraState.Preview"/> or the <see cref="CameraState.Captured"/> state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <param name="continuous">Continuous auto focus.</param>
- /// <privilege>
- /// http://tizen.org/privilege/camera
- /// </privilege>
+ /// <since_tizen> 3 </since_tizen>
+ /// <privilege> http://tizen.org/privilege/camera </privilege>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <remarks>
/// If continuous status is true, the camera continuously tries to focus.
/// </remarks>
/// The camera must be in the <see cref="CameraState.Preview"/> or the <see cref="CameraState.Captured"/> state.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <privilege>
- /// http://tizen.org/privilege/camera
- /// </privilege>
+ /// <privilege> http://tizen.org/privilege/camera </privilege>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
/// The camera must be in the <see cref="CameraState.Preview"/> state.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <privilege>
- /// http://tizen.org/privilege/camera
- /// </privilege>
+ /// <privilege> http://tizen.org/privilege/camera </privilege>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <remarks>
/// This should be called after <see cref="StartPreview"/> is started.
/// The Eventhandler set using <see cref="FaceDetected"/> is invoked when the face is detected in the preview frame.
/// Stops face detection.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <privilege>
- /// http://tizen.org/privilege/camera
- /// </privilege>
+ /// <privilege> http://tizen.org/privilege/camera </privilege>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="NotSupportedException">In case of this feature is not supported.</exception>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
IsZoomSupported = CheckRangeValid(NativeSettings.GetZoomRange);
IsPanSupported = CheckRangeValid(NativeSettings.GetPanRange);
IsTiltSupported = CheckRangeValid(NativeSettings.GetTiltRange);
+ IsHueSupported = CheckRangeValid(NativeSettings.GetHueRange);
}
private bool IsFeatureSupported(IsSupportedDelegate func)
public bool IsTiltSupported { get; }
/// <summary>
+ /// Gets the support state of the hue feature.
+ /// </summary>
+ /// <value>true if supported, otherwise false.</value>
+ /// <since_tizen> 5 </since_tizen>
+ public bool IsHueSupported { get; }
+
+ /// <summary>
/// Retrieves all the preview resolutions supported by the camera.
/// </summary>
/// <since_tizen> 4 </since_tizen>
/// <summary>
/// Retrieves all the fps by resolution supported by the camera.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <param name="width">The width of required preview resolution.</param>
/// <param name="height">The height of required preview resolution.</param>
/// <returns>
/// It returns a list containing all the supported <see cref="CameraFps"/> by resolution.
/// </returns>
+ /// <since_tizen> 4 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public IEnumerable<CameraFps> GetSupportedPreviewFpsByResolution(int width, int height)
{
/// <summary>
/// Retrieves all the fps by resolution supported by the camera.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <param name="size">The size of required preview resolution.</param>
/// <returns>
/// It returns a list containing all the supported <see cref="CameraFps"/> by resolution.
/// </returns>
+ /// <since_tizen> 4 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public IEnumerable<CameraFps> GetSupportedPreviewFpsByResolution(Size size)
{
/// <summary>
/// Retrieves all the auto focus modes supported by the camera.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <returns>
/// It returns a list containing all the supported <see cref="CameraAutoFocusMode"/>.
/// </returns>
+ /// <since_tizen> 4 </since_tizen>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public IEnumerable<CameraAutoFocusMode> SupportedAutoFocusModes
{
/// <summary>
/// Retrieves all the exposure modes supported by the camera.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <returns>
/// It returns a list containing all the supported <see cref="CameraExposureMode"/>.
/// </returns>
+ /// <since_tizen> 4 </since_tizen>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public IEnumerable<CameraExposureMode> SupportedExposureModes
{
/// <summary>
/// The front camera device.
/// </summary>
- Front
+ Front,
+ /// <summary>
+ /// The primary camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice0 = Rear,
+ /// <summary>
+ /// The secondary camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice1 = Front,
+ /// <summary>
+ /// The third camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice2,
+ /// <summary>
+ /// The 4th camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice3,
+ /// <summary>
+ /// The 5th camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice4,
+ /// <summary>
+ /// The 6th camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice5,
+ /// <summary>
+ /// The 7th camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice6,
+ /// <summary>
+ /// The 8th camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice7,
+ /// <summary>
+ /// The 9th camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice8,
+ /// <summary>
+ /// The 10th camera device.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ CameraDevice9
}
/// <summary>
private readonly Range? _brightnessRange;
private readonly Range? _contrastRange;
+ private readonly Range? _exposureRange;
+ private readonly Range? _hueRange = null;
private readonly Range? _panRange;
private readonly Range? _tiltRange;
- private readonly Range? _exposureRange;
private readonly Range? _zoomRange;
internal CameraSettings(Camera camera)
{
_camera = camera;
- _contrastRange = GetRange(Native.GetContrastRange);
_brightnessRange = GetRange(Native.GetBrightnessRange);
+ _contrastRange = GetRange(Native.GetContrastRange);
_exposureRange = GetRange(Native.GetExposureRange);
- _zoomRange = GetRange(Native.GetZoomRange);
+ _hueRange = GetRange(Native.GetHueRange);
_panRange = GetRange(Native.GetPanRange);
_tiltRange = GetRange(Native.GetTiltRange);
+ _zoomRange = GetRange(Native.GetZoomRange);
}
private delegate CameraError GetRangeDelegate(IntPtr handle, out int min, out int max);
/// <summary>
/// Sets the auto focus area.
/// </summary>
+ /// <param name="x">X position.</param>
+ /// <param name="y">Y position.</param>
/// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <remarks>
/// <see cref="CameraAutoFocusMode"/> should not be the <see cref="CameraAutoFocusMode.None"/>.
/// </remarks>
- /// <param name="x">X position.</param>
- /// <param name="y">Y position.</param>
- /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+ /// /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public void SetAutoFocusArea(int x, int y)
/// <summary>
/// Sets the auto focus area.
/// </summary>
+ /// <param name="pos"><see cref="Point"/> structure including X, Y position.</param>
/// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <remarks>
/// <see cref="CameraAutoFocusMode"/> should not be the <see cref="CameraAutoFocusMode.None"/>.
/// </remarks>
- /// <param name="pos"><see cref="Point"/> structure including X, Y position.</param>
- /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
+ /// /// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="InvalidOperationException">In case of any invalid operations.</exception>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public void SetAutoFocusArea(Point pos)
/// Clears the auto focus area.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public void ClearFocusArea()
{
"Failed to set camera enable auto contrast.");
}
}
+
/// <summary>
/// Gets the available contrast level.
/// </summary>
}
#endregion Contrast
+ #region Hue
+ /// <summary>
+ /// The hue level of the camera.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
+ public int Hue
+ {
+ get
+ {
+ CameraErrorFactory.ThrowIfError(Native.GetHue(_camera.GetHandle(), out int val),
+ "Failed to get camera hue value");
+
+ return val;
+ }
+
+ set
+ {
+ CameraErrorFactory.ThrowIfError(Native.SetHue(_camera.GetHandle(), value),
+ "Failed to set camera hue value.");
+ }
+ }
+
+ /// <summary>
+ /// Gets the available hue level.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// <remarks>
+ /// If HueRange returns null, it means that hue feature is not supported.
+ /// It can be checked also with <seec cref="CameraCapabilities.IsHueSupported"/>.
+ /// </remarks>
+ /// <seealso cref="Hue"/>
+ public Range? HueRange
+ {
+ get
+ {
+ if (!_hueRange.HasValue)
+ {
+ return null;
+ }
+
+ return _hueRange.Value;
+ }
+ }
+ #endregion
+
#region Brightness
/// <summary>
/// The brightness level of the camera.
/// <summary>
/// Turn the shutter sound on or off, if it is permitted by policy.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
/// <param name="shutterSound">Shutter sound On/Off flag</param>
+ /// <since_tizen> 4 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <remarks>
/// If this value is true, shutter sound will be disabled, otherwise enabled.
/// In some countries, this operation is not permitted.
/// <summary>
/// Sets the position to move horizontally.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <param name="type">The PTZ move type. <seealso cref="CameraPtzMoveType"/>.</param>
/// <param name="panStep">The pan step.</param>
+ /// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public void SetPan(CameraPtzMoveType type, int panStep)
/// <summary>
/// Gets the current position of the camera.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <returns>Returns the camera's horizontal position.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public int GetPan()
{
/// <summary>
/// Sets the position to move vertically.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <param name="type">the PTZ move type.</param>
/// <param name="tiltStep">The tilt step.</param>
+ /// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ArgumentException">In case of invalid parameters.</exception>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public void SetTilt(CameraPtzMoveType type, int tiltStep)
/// Gets the current position of the camera.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <returns>Returns the current vertical position.</returns>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public int GetTilt()
/// Removes the geo tag(GPS data) in the EXIF(EXchangeable Image File format) tag.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <exception cref="ObjectDisposedException">The camera already has been disposed of.</exception>
public void RemoveGeoTag()
{
/// <param name="latitude">The latitude data.</param>
/// <param name="longitude">The longitude data.</param>
/// <param name="altitude">The altitude data.</param>
+ /// <feature> http://tizen.org/feature/camera </feature>
/// <since_tizen> 3 </since_tizen>
public Location(double latitude, double longitude, double altitude)
{
[DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_contrast_range")]
internal static extern CameraError GetContrastRange(IntPtr handle, out int min, out int max);
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_hue")]
+ internal static extern CameraError SetHue(IntPtr handle, int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_hue")]
+ internal static extern CameraError GetHue(IntPtr handle, out int level);
+
+ [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_hue_range")]
+ internal static extern CameraError GetHueRange(IntPtr handle, out int min, out int max);
+
[DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_whitebalance")]
internal static extern CameraError SetWhitebalance(IntPtr handle, CameraWhiteBalance level);