2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Tizen.Content.MediaContent
22 /// Represents the face information for the media.
24 /// <since_tizen> 4 </since_tizen>
25 [Obsolete("Deprecated since API11. Will be removed in API13.")]
28 internal FaceInfo(IntPtr handle)
30 Id = InteropHelper.GetString(handle, Interop.Face.GetId);
31 MediaInfoId = InteropHelper.GetString(handle, Interop.Face.GetMediaId);
33 Tag = InteropHelper.GetString(handle, Interop.Face.GetTag);
34 Orientation = InteropHelper.GetValue<IntPtr, Orientation>(handle, Interop.Face.GetOrientation);
36 Rect = GetRect(handle);
39 private static Rectangle GetRect(IntPtr faceHandle)
41 Interop.Face.GetFaceRect(faceHandle, out var x, out var y, out var width, out var height).
42 ThrowIfError("Failed to get rect for the face info");
44 return new Rectangle(x, y, width, height);
50 /// <value>The region of face in the media.</value>
52 /// The coordinates of the rectangle are orientation-applied values.
54 /// <since_tizen> 4 </since_tizen>
55 [Obsolete("Deprecated since API11. Will be removed in API13.")]
56 public Rectangle Rect { get; }
59 /// Gets the ID of face information.
61 /// <value>The unique ID of face information.</value>
62 /// <since_tizen> 4 </since_tizen>
63 [Obsolete("Deprecated since API11. Will be removed in API13.")]
64 public string Id { get; }
67 /// Gets the media ID that the face information is added.
69 /// <value>The media ID that the face information is added.</value>
70 /// <since_tizen> 4 </since_tizen>
71 [Obsolete("Deprecated since API11. Will be removed in API13.")]
72 public string MediaInfoId { get; }
77 /// <value>The tag of face information.</value>
78 /// <since_tizen> 4 </since_tizen>
79 [Obsolete("Deprecated since API11. Will be removed in API13.")]
80 public string Tag { get; }
83 /// Gets the orientation of face information.
85 /// <value>The orientation of face information.</value>
86 /// <since_tizen> 4 </since_tizen>
87 [Obsolete("Deprecated since API11. Will be removed in API13.")]
88 public Orientation Orientation { get; }
90 internal static FaceInfo FromHandle(IntPtr handle)
92 return new FaceInfo(handle);
96 /// Returns a string representation of the face information.
98 /// <returns>A string representation of the current face info.</returns>
99 /// <since_tizen> 4 </since_tizen>
100 [Obsolete("Deprecated since API11. Will be removed in API13.")]
101 public override string ToString() =>
102 $"Id={Id}, MediaInfoId={MediaInfoId}, Rect=({Rect}), Tag={Tag}";