Class OpenCvSafeHandle
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Base class for SafeHandle instances wrapping native OpenCV pointers.
Provides a common SafeHandle implementation where IntPtr.Zero is the invalid handle value.
public abstract class OpenCvSafeHandle : SafeHandle, IDisposable
- Inheritance
-
OpenCvSafeHandle
- Implements
- Derived
- Inherited Members
Constructors
OpenCvSafeHandle()
Initializes a new instance of the OpenCvSafeHandle class that owns the handle.
protected OpenCvSafeHandle()
OpenCvSafeHandle(bool)
Initializes a new instance of the OpenCvSafeHandle class.
protected OpenCvSafeHandle(bool ownsHandle)
Parameters
ownsHandlebooltrueif this instance owns the handle and should release it on disposal;falsefor a borrowed (non-owning) wrapper around an existing pointer.
OpenCvSafeHandle(nint, bool)
Initializes a new instance of the OpenCvSafeHandle class with an existing handle.
protected OpenCvSafeHandle(nint existingHandle, bool ownsHandle)
Parameters
existingHandlenintThe pre-existing native pointer to wrap.
ownsHandlebooltrueif this instance owns the handle and should release it on disposal;falsefor a borrowed (non-owning) wrapper.
Properties
IsInvalid
When overridden in a derived class, gets a value indicating whether the handle value is invalid.
public override bool IsInvalid { get; }