Name: csapi-multimedia
Summary: Tizen Multimedia API for C#
-Version: 1.0.52
+Version: 1.0.53
Release: 0
Group: Development/Libraries
License: Apache-2.0
/// Initializes a new instance of the <see cref="BarcodeDetectionConfiguration"/> class.
/// </summary>
/// <exception cref="System.NotSupportedException">The feature is not supported.</exception>
- public BarcodeDetectionConfiguration()
+ public BarcodeDetectionConfiguration() : base("barcode_detection")
{
}
/// Initializes a new instance of the <see cref="BarcodeGenerationConfiguration"/> class.
/// </summary>
/// <exception cref="System.NotSupportedException">The feature is not supported.</exception>
- public BarcodeGenerationConfiguration()
+ public BarcodeGenerationConfiguration() : base("barcode_generation")
{
}
*/
using System;
+using Tizen.System;
using System.Runtime.InteropServices;
using static Tizen.Multimedia.Interop.MediaVision;
private IntPtr _handle = IntPtr.Zero;
private bool _disposed = false;
- internal EngineConfiguration()
+ private const string _featurePath = "http://tizen.org/feature/vision.";
+
+ private bool IsSupportedEngineType(string type)
{
+ bool isSupported = false;
+
+ string featureType = _featurePath + type;
+
+ bool ret = SystemInfo.TryGetValue(featureType, out isSupported);
+
+ return (isSupported && ret) ? true : false;
+ }
+
+ private bool IsSupportedEngineType(string type1, string type2)
+ {
+ return (IsSupportedEngineType(type1) && IsSupportedEngineType(type2)) ? true : false;
+ }
+
+ internal EngineConfiguration(string engineType)
+ {
+ if (IsSupportedEngineType(engineType) == false)
+ {
+ throw new NotSupportedException($"{engineType} : Not Supported");
+ }
+
+ EngineConfig.Create(out _handle).Validate("Failed to create media vision engine.");
+ }
+
+ internal EngineConfiguration(string engineType1, string engineType2)
+ {
+
+ if (IsSupportedEngineType(engineType1, engineType2) == false)
+ {
+ throw new NotSupportedException($"{engineType1} or {engineType2} : Not Supported");
+ }
+
EngineConfig.Create(out _handle).Validate("Failed to create media vision engine.");
}
/// Initializes a new instance of the <see cref="FaceDetectionConfiguration"/> class.
/// </summary>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
- public FaceDetectionConfiguration()
+ public FaceDetectionConfiguration() : base("face_recognition")
{
}
/// Initializes a new instance of the <see cref="FaceRecognitionConfiguration"/> class.
/// </summary>
/// <exception cref="System.NotSupportedException">The feature is not supported.</exception>
- public FaceRecognitionConfiguration()
+ public FaceRecognitionConfiguration() : base("face_recognition")
{
}
{
if (source == null)
{
- throw new ArgumentException("Invalid source");
+ throw new ArgumentNullException(nameof(source));
}
InvokeAdd(source, label, null).Validate("Failed to add face example image");
{
if (source == null)
{
- throw new ArgumentException("Invalid source");
+ throw new ArgumentNullException(nameof(source));
}
InvokeAdd(source, label, area).Validate("Failed to add face example image");
/// </remarks>
/// <param name="modelPath">Path to the model to load.</param>
/// <exception cref="ArgumentNullException"><paramref name="modelPath"/> is null.</exception>
- /// <exception cref="System.IO.FileNotFoundException"><paramref name="modelPath"/> is invalid.</exception>
+ /// <exception cref="FileNotFoundException"><paramref name="modelPath"/> is invalid.</exception>
/// <exception cref="NotSupportedException">
/// The feature is not supported.\n
/// - or -\n
/// </summary>
/// <remarks>
/// <paramref name="region"/> needs to be the position of the face to be tracked when called first time for the tracking model.
+ /// <paramref name="region"/> is fitted to the valid region of <paramref name="source"/> if <paramref name="region"/> has invalid points.
/// </remarks>
/// <param name="source">The source where face location is specified.
/// Usually it is the first frame of the video or the first image in the continuous
/// <param name="region">The region determining position of the face to be tracked on the source.
/// If null, then tracking model will try to find previously tracked face by itself.</param>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
- /// <exception cref="ArgumentException"><paramref name="region"/> has invalid points.</exception>
/// <exception cref="ObjectDisposedException">
/// The <see cref="FaceTrackingModel"/> has already been disposed of.\n
/// - or -\n
/// Initializes a new instance of the <see cref="ImageFillConfiguration"/> class.
/// </summary>
/// <exception cref="System.NotSupportedException">The feature is not supported.</exception>
- public ImageFillConfiguration()
+ public ImageFillConfiguration() : base("image_recognition")
{
}
/// <paramref name="source"/> has already been disposed of.\n
/// - or -\n
/// <paramref name="config"/> has already been disposed of.
- /// </exception
+ /// </exception>
public void Fill(MediaVisionSource source, ImageFillConfiguration config)
{
InvokeFill(source, config, null);
/// The <see cref="ImageObject"/> has already been disposed of.\n
/// - or -\n
/// <paramref name="source"/> has already been disposed of.\n
- /// </exception
+ /// </exception>
public void Fill(MediaVisionSource source, Rectangle rect)
{
InvokeFill(source, null, rect);
/// <paramref name="source"/> has already been disposed of.\n
/// - or -\n
/// <paramref name="config"/> has already been disposed of.
- /// </exception
+ /// </exception>
public void Fill(MediaVisionSource source, ImageFillConfiguration config, Rectangle rect)
{
InvokeFill(source, config, rect);
return InteropImage.Fill(Handle, config, source, ref rect);
}
- /// <summary>
- /// Fills the image object.\n
- /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location.
- /// </summary>
- /// <param name="source">The source image where image object is depicted.</param>
- /// <param name="config">The configuration used for extract recognition data from source. This value can be null.</param>
- /// <param name="area">Location of the image object on the source image, or NULL if the object is shown in full</param>
- /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
- /// <exception cref="ObjectDisposedException">
- /// The <see cref="ImageObject"/> has already been disposed of.\n
- /// - or -\n
- /// <paramref name="source"/> has already been disposed of.
- /// </exception
private void InvokeFill(MediaVisionSource source, ImageFillConfiguration config, Rectangle? area)
{
if (source == null)
/// Initializes a new instance of the <see cref="ImageRecognitionConfiguration"/> class.
/// </summary>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
- public ImageRecognitionConfiguration()
+ public ImageRecognitionConfiguration() : base("image_recognition")
{
}
/// - or -\n
/// <paramref name="trackingModel"/> has already been disposed of.
/// </exception>
- /// <exception cref="InvalidOperationException"><paramref name="trackingModel"/> has no target.</exception>
+ /// <exception cref="ArgumentException"><paramref name="trackingModel"/> has no target.</exception>
/// <seealso cref="ImageTrackingModel.SetTarget(ImageObject)"/>
public static async Task<Quadrangle> TrackAsync(MediaVisionSource source,
ImageTrackingModel trackingModel)
/// - or -\n
/// <paramref name="config"/> has already been disposed of.
/// </exception>
- /// <exception cref="InvalidOperationException"><paramref name="trackingModel"/> has no target.</exception>
+ /// <exception cref="ArgumentException"><paramref name="trackingModel"/> has no target.</exception>
/// <seealso cref="ImageTrackingModel.SetTarget(ImageObject)"/>
public static async Task<Quadrangle> TrackAsync(MediaVisionSource source,
ImageTrackingModel trackingModel, ImageTrackingConfiguration config)
/// </remarks>
/// <param name="modelPath">Path to the model to load.</param>
/// <exception cref="ArgumentNullException"><paramref name="modelPath"/> is null.</exception>
- /// <exception cref="System.IO.FileNotFoundException"><paramref name="modelPath"/> is invalid.</exception>
+ /// <exception cref="FileNotFoundException"><paramref name="modelPath"/> is invalid.</exception>
/// <exception cref="NotSupportedException">
/// The feature is not supported.\n
/// - or -\n
/// <summary>
/// Permission denied
/// </summary>
- PermissionDenied = ErrorCode.PermissionDenied,
+ PermissionDenied = ErrorCode.NotPermitted,
/// <summary>
/// Not supported format
/// </summary>
catch(Exception)
{
InteropSource.Destroy(_handle);
+ _disposed = true;
throw;
}
}
{
return;
}
-
InteropSource.Destroy(_handle);
_disposed = true;
}
/// - or -\n
/// <paramref name="config"/> has already been disposed of.
/// </exception>
- /// <exception cref="System.IO.FileNotFoundException">
+ /// <exception cref="ArgumentException">
/// <see cref="PersonRecognitionConfiguration.FaceRecognitionModelPath"/> of <paramref name="config"/> does not exists.
/// </exception>
/// <exception cref="UnauthorizedAccessException">
/// </summary>
public class SurveillanceEngineConfiguration : EngineConfiguration
{
- internal SurveillanceEngineConfiguration()
+ internal SurveillanceEngineConfiguration() : base("face_recognition", "image_recognition")
{
}
}
internal abstract void OnEventDetected(IntPtr trigger, IntPtr source,
int streamId, IntPtr eventResult, IntPtr userData);
- /// <summary>
- /// Subscribes trigger to process sources pushed from video identified by @a videoStreamId.
- /// </summary>
internal void InvokeAddSource(SurveillanceSource source, SurveillanceEngineConfiguration config)
{
if (source == null)
"ElmSharp": "1.1.0-*",
"NETStandard.Library": "1.6.1",
"Tizen": "1.0.3",
- "Tizen.Applications": "1.3.2"
+ "Tizen.Applications": "1.3.2",
+ "Tizen.System.Information": "1.0.3"
},
"frameworks": {
"netstandard1.3": {}