Table of Contents

Class CvPtrObject

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Base class for OpenCV Algorithm-hierarchy objects. Stores both the smart pointer (cv::Ptr<T>) for lifetime management and the raw T for P/Invoke calls, so that RawPtr always returns the raw pointer without ambiguity.

public abstract class CvPtrObject : DisposableObject, IDisposable
Inheritance
CvPtrObject
Implements
Derived
Inherited Members

Constructors

CvPtrObject(nint, Action<nint>)

Direct-allocation constructor. rawPtr is a T* that is released directly by releaseRawPtr.

protected CvPtrObject(nint rawPtr, Action<nint> releaseRawPtr)

Parameters

rawPtr nint
releaseRawPtr Action<nint>

CvPtrObject(nint, nint, Action<nint>)

Factory-pattern constructor. smartPtr is a cv::Ptr<T>* that owns the object lifetime; rawPtr is the T* extracted from it for P/Invoke.

protected CvPtrObject(nint smartPtr, nint rawPtr, Action<nint> releaseSmartPtr)

Parameters

smartPtr nint
rawPtr nint
releaseSmartPtr Action<nint>

Properties

RawPtr

Returns the raw T* for use in P/Invoke calls.

public nint RawPtr { get; }

Property Value

nint

Methods

DisposeManaged()

Releases managed resources

protected override void DisposeManaged()

DisposeUnmanaged()

Releases unmanaged resources

protected override void DisposeUnmanaged()