Table of Contents

Class MatSafeHandle

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

A OpenCvSafeHandle that releases a native cv::Mat* pointer.

public sealed class MatSafeHandle : OpenCvSafeHandle, IDisposable
Inheritance
MatSafeHandle
Implements
Inherited Members

Constructors

MatSafeHandle()

Initializes a new owning instance (used by P/Invoke out parameters).

public MatSafeHandle()

MatSafeHandle(nint, bool)

Wraps an existing native cv::Mat* pointer.

public MatSafeHandle(nint existingHandle, bool ownsHandle)

Parameters

existingHandle nint

The pre-existing native pointer.

ownsHandle bool

true if this instance should call core_Mat_delete on disposal; false for borrowed pointers that are owned by another object.

Methods

ReleaseHandle()

When overridden in a derived class, executes the code required to free the handle.

protected override bool ReleaseHandle()

Returns

bool

true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. In this case, it generates a releaseHandleFailed Managed Debugging Assistant.