using System.IO;
using InteropImage = Interop.MediaVision.Image;
-namespace Tizen.Multimedia
+namespace Tizen.Multimedia.Vision
{
/// <summary>
/// Represents an image object.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class ImageObject : IDisposable
{
private IntPtr _handle = IntPtr.Zero;
/// Initializes a new instance of the <see cref="ImageObject"/> class.
/// </summary>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
+ /// <since_tizen> 3 </since_tizen>
public ImageObject()
{
InteropImage.Create(out _handle).Validate("Failed to create image object");
/// <exception cref="FileNotFoundException"><paramref name="path"/> is invalid.</exception>
/// <exception cref="NotSupportedException">
/// The feature is not supported.\n
- /// - or -\n
+ /// -or-\n
/// <paramref name="path"/> is not supported file.
/// </exception>
/// <exception cref="UnauthorizedAccessException">No permission to access the specified file.</exception>
/// <seealso cref="Save(string)"/>
+ /// <since_tizen> 3 </since_tizen>
public ImageObject(string path)
{
if (path == null)
/// </value>
/// <exception cref="ObjectDisposedException">The <see cref="ImageObject"/> has already been disposed of.</exception>
/// <seealso cref="ImageFillConfiguration"/>
- /// <seealso cref="Fill(MediaVisionSource, ImageFillConfiguration, Rectangle?)"/>
+ /// <seealso cref="Fill(MediaVisionSource)"/>
+ /// <seealso cref="Fill(MediaVisionSource, ImageFillConfiguration)"/>
+ /// <seealso cref="Fill(MediaVisionSource, Rectangle)"/>
+ /// <seealso cref="Fill(MediaVisionSource, ImageFillConfiguration, Rectangle)"/>
+ /// <since_tizen> 3 </since_tizen>
public double RecognitionRate
{
get
{
- double rate = 0;
- InteropImage.GetRecognitionRate(Handle, out rate).Validate("Failed to get recognition rate");
+ InteropImage.GetRecognitionRate(Handle, out var rate).Validate("Failed to get recognition rate");
return rate;
}
}
/// Gets the label for the image object.
/// </summary>
/// <returns>
- /// The label value; or null if the <see cref="ImageObject"/> has no label.
+ /// The label value if the <see cref="ImageObject"/> has label, otherwise null.
/// </returns>
/// <exception cref="ObjectDisposedException">The <see cref="ImageObject"/> has already been disposed of.</exception>
/// <seealso cref="SetLabel(int)"/>
+ /// <since_tizen> 3 </since_tizen>
public int? GetLabel()
{
- int label = 0;
- var ret = InteropImage.GetLabel(Handle, out label);
+ var ret = InteropImage.GetLabel(Handle, out var label);
if (ret == MediaVisionError.NoData)
{
/// Sets the label for the <see cref="ImageObject"/>.
/// </summary>
/// <seealso cref="GetLabel"/>
+ /// <since_tizen> 3 </since_tizen>
public void SetLabel(int label)
{
InteropImage.SetLabel(Handle, label).Validate("Failed to set label");
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="ObjectDisposedException">
/// The <see cref="ImageObject"/> has already been disposed of.\n
- /// - or -\n
+ /// -or-\n
/// <paramref name="source"/> has already been disposed of.
/// </exception>
+ /// <since_tizen> 3 </since_tizen>
public void Fill(MediaVisionSource source)
{
InvokeFill(source, null, null);
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="ObjectDisposedException">
/// The <see cref="ImageObject"/> has already been disposed of.\n
- /// - or -\n
+ /// -or-\n
/// <paramref name="source"/> has already been disposed of.\n
- /// - or -\n
+ /// -or-\n
/// <paramref name="config"/> has already been disposed of.
/// </exception>
+ /// <since_tizen> 3 </since_tizen>
public void Fill(MediaVisionSource source, ImageFillConfiguration config)
{
InvokeFill(source, config, null);
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="ObjectDisposedException">
/// The <see cref="ImageObject"/> has already been disposed of.\n
- /// - or -\n
+ /// -or-\n
/// <paramref name="source"/> has already been disposed of.\n
/// </exception>
+ /// <since_tizen> 3 </since_tizen>
public void Fill(MediaVisionSource source, Rectangle rect)
{
InvokeFill(source, null, rect);
/// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
/// <exception cref="ObjectDisposedException">
/// The <see cref="ImageObject"/> has already been disposed of.\n
- /// - or -\n
+ /// -or-\n
/// <paramref name="source"/> has already been disposed of.\n
- /// - or -\n
+ /// -or-\n
/// <paramref name="config"/> has already been disposed of.
/// </exception>
+ /// <since_tizen> 3 </since_tizen>
public void Fill(MediaVisionSource source, ImageFillConfiguration config, Rectangle rect)
{
InvokeFill(source, config, rect);
/// <exception cref="UnauthorizedAccessException">No permission to write to the specified path.</exception>
/// <exception cref="ObjectDisposedException">The <see cref="FaceRecognitionModel"/> has already been disposed of.</exception>
/// <exception cref="DirectoryNotFoundException">The directory for <paramref name="path"/> does not exist.</exception>
+ /// <since_tizen> 3 </since_tizen>
public void Save(string path)
{
if (path == null)
#endregion
#region IDisposable-support
+
+ /// <summary>
+ /// Releases all the resources used by the <see cref="ImageObject"/> object.
+ /// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
+ /// <summary>
+ /// Releases the resources used by the <see cref="ImageObject"/> object.
+ /// </summary>
+ /// <param name="disposing">
+ /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources.
+ /// </param>
protected virtual void Dispose(bool disposing)
{
if (_disposed)