[NUI] TCSACR-226 code change (#1032)
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Vision / MediaVision / ImageFillConfiguration.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
19 namespace Tizen.Multimedia.Vision
20 {
21     /// <summary>
22     /// Represents a configuration of fill operations of <see cref="ImageObject"/> instances.
23     /// </summary>
24     /// <feature>http://tizen.org/feature/vision.image_recognition</feature>
25     /// <since_tizen> 4 </since_tizen>
26     public class ImageFillConfiguration : EngineConfiguration
27     {
28         private const string KeyScaleFactor = "MV_IMAGE_RECOGNITION_OBJECT_SCALE_FACTOR";
29         private const string KeyMaxKeypoints = "MV_IMAGE_RECOGNITION_OBJECT_MAX_KEYPOINTS_NUM";
30
31         /// <summary>
32         /// A read-only field that represents the default value of <see cref="ObjectScaleFactor"/>.
33         /// </summary>
34         /// <since_tizen> 4 </since_tizen>
35         public static readonly double DefaultScaleFactor = 1.2;
36
37         /// <summary>
38         /// A read-only field that represents the default value of <see cref="ObjectMaxKeyPoints"/>.
39         /// </summary>
40         /// <since_tizen> 4</since_tizen>
41         public static readonly int DefaultMaxKeypoints = 1000;
42
43         /// <summary>
44         /// Initializes a new instance of the <see cref="ImageFillConfiguration"/> class.
45         /// </summary>
46         /// <exception cref="NotSupportedException">The feature is not supported.</exception>
47         /// <since_tizen> 4 </since_tizen>
48         public ImageFillConfiguration() : base("image_recognition")
49         {
50         }
51
52         /// <summary>
53         /// Gets or sets the scale factor the image to be recognized.<br/>
54         /// The value of the factor will be used for resizing of the images (objects) for recognition.
55         /// The default value is 1.2.
56         /// </summary>
57         /// <exception cref="ObjectDisposedException">The <see cref="ImageFillConfiguration"/> already has been disposed of.</exception>
58         /// <since_tizen> 4 </since_tizen>
59         public double ObjectScaleFactor
60         {
61             get
62             {
63                 return GetDouble(KeyScaleFactor);
64             }
65             set
66             {
67                 Set(KeyScaleFactor, value);
68             }
69         }
70
71         /// <summary>
72         /// Gets or sets the maximum key points should be detected on the image.<br/>
73         /// The maximal number of key points can be selected on the image object to calculate descriptors.
74         /// This key points will be used for image (object) recognition and has to be specified as integer number.
75         /// The default value is 1000.
76         /// </summary>
77         /// <exception cref="ObjectDisposedException">The <see cref="ImageFillConfiguration"/> already has been disposed of.</exception>
78         /// <since_tizen> 4 </since_tizen>
79         public int ObjectMaxKeyPoints
80         {
81             get
82             {
83                 return GetInt(KeyMaxKeypoints);
84             }
85             set
86             {
87                 Set(KeyMaxKeypoints, value);
88             }
89         }
90     }
91 }