Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Camera / Camera / FaceDetectionData.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.Runtime.InteropServices;
19 using static Interop.Camera;
20
21 namespace Tizen.Multimedia
22 {
23     /// <summary>
24     /// The class contains the details of the detected face.
25     /// </summary>
26     public class FaceDetectionData
27     {
28         internal FaceDetectionData(IntPtr ptr)
29         {
30             var unmanagedStruct = Marshal.PtrToStructure<DetectedFaceStruct>(ptr);
31
32             Id = unmanagedStruct.Id;
33             Score = unmanagedStruct.Score;
34             X = unmanagedStruct.X;
35             Y = unmanagedStruct.Y;
36             Width = unmanagedStruct.Width;
37             Height = unmanagedStruct.Height;
38         }
39
40         /// <summary>
41         /// The Id of each face.
42         /// </summary>
43         /// <since_tizen> 3 </since_tizen>
44         public int Id { get; }
45
46         /// <summary>
47         /// The confidence level for the detection of the face.
48         /// </summary>
49         /// <since_tizen> 3 </since_tizen>
50         public int Score { get; }
51
52         /// <summary>
53         /// The X co-ordinate of the face.
54         /// </summary>
55         /// <since_tizen> 3 </since_tizen>
56         public int X { get; }
57
58         /// <summary>
59         /// The Y co-ordinate of the face.
60         /// </summary>
61         /// <since_tizen> 3 </since_tizen>
62         public int Y { get; }
63
64         /// <summary>
65         /// The width of the face.
66         /// </summary>
67         /// <since_tizen> 3 </since_tizen>
68         public int Width { get; }
69
70         /// <summary>
71         /// The height of the face.
72         /// </summary>
73         /// <since_tizen> 3 </since_tizen>
74         public int Height { get; }
75     }
76 }
77