Skip to content

Commit

Permalink
Merge pull request #1208 from shimat/window
Browse files Browse the repository at this point in the history
restore window constructor
  • Loading branch information
shimat authored Feb 10, 2021
2 parents 4c81e6b + 1a6950d commit 8b5316d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/OpenCvSharp/Modules/dnn/Net.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using OpenCvSharp.Internal;
using OpenCvSharp.Internal.Vectors;
Expand All @@ -23,6 +24,7 @@ namespace OpenCvSharp.Dnn
/// LayerId can store either layer name or layer id.
/// This class supports reference counting of its instances, i.e.copies point to the same instance.
/// </remarks>
[SuppressMessage("Microsoft.Design", "CA1724: Type names should not match namespaces")]
public class Net : DisposableCvObject
{
#region Init & Disposal
Expand Down
32 changes: 31 additions & 1 deletion src/OpenCvSharp/Modules/highgui/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,37 @@ public Window()
: this(DefaultName(), null, WindowFlags.AutoSize)
{
}


/// <summary>
/// Creates a window
/// </summary>
/// <param name="name">Name of the window which is used as window identifier and appears in the window caption. </param>
public Window(string name)
: this(name, null, WindowFlags.AutoSize)
{
}

/// <summary>
/// Creates a window
/// </summary>
/// <param name="name">Name of the window which is used as window identifier and appears in the window caption. </param>
/// <param name="flags">Flags of the window. Currently the only supported flag is WindowMode.AutoSize.
/// If it is set, window size is automatically adjusted to fit the displayed image (see cvShowImage), while user can not change the window size manually. </param>
public Window(string name, WindowFlags flags = WindowFlags.AutoSize)
: this(name, null, flags)
{
}

/// <summary>
/// Creates a window
/// </summary>
/// <param name="name">Name of the window which is used as window identifier and appears in the window caption. </param>
/// <param name="image">Image to be shown.</param>
public Window(string name, Mat image)
: this(name, image ?? throw new ArgumentNullException(nameof(image)), WindowFlags.AutoSize)
{
}

/// <summary>
/// Creates a window
/// </summary>
Expand Down

0 comments on commit 8b5316d

Please sign in to comment.