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