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