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.Multimedia.Vision
22 /// Represents a configuration of <see cref="MovementDetector"/>.
24 /// <since_tizen> 3</since_tizen>
25 public class MovementDetectionConfiguration : SurveillanceEngineConfiguration
27 private const string KeyThreshold = "MV_SURVEILLANCE_MOVEMENT_DETECTION_THRESHOLD";
30 /// A read-only field that represents the default value of <see cref="Threshold"/>.
32 /// <since_tizen> 3</since_tizen>
33 public static readonly int DefaultThreshold = 10;
37 /// Initializes a new instance of the <see cref="MovementDetectionConfiguration"/> class.
39 /// <exception cref="NotSupportedException">The feature is not supported.</exception>
40 /// <since_tizen> 3</since_tizen>
41 public MovementDetectionConfiguration()
46 /// Gets or sets movement detection threshold.\n
47 /// This value might be set before subscription on <see cref="MovementDetector.Detected"/> event
48 /// to specify the sensitivity of the movement detector.
51 /// The value indicating the sensitivity of the <see cref="MovementDetector"/> from 0 to 255 inclusive
52 /// where 255 means that no movements will be detected and 0 means that all frame changes
53 /// will be interpreted as movements.\n
54 /// The default is 10.
56 /// <exception cref="ObjectDisposedException">The <see cref="MovementDetectionConfiguration"/> already has been disposed of.</exception>
57 /// <exception cref="ArgumentOutOfRangeException">
58 /// <paramref name="value"/> is less than zero.\n
60 /// <paramref name="value"/> is greater than 255.
62 /// <since_tizen> 3</since_tizen>
67 return GetInt(KeyThreshold);
71 if (value < 0 || value > 255)
73 throw new ArgumentOutOfRangeException(nameof(Threshold), value,
74 $"Valid {nameof(Threshold)} range is 0 to 255 inclusive");
77 Set(KeyThreshold, value);