Table of Contents

Class MatMemoryManager<T>

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

A MemoryManager over an OpenCvSharpMat

public sealed class MatMemoryManager<T> : MemoryManager<T>, IMemoryOwner<T>, IDisposable, IPinnable where T : unmanaged

Type Parameters

T
Inheritance
MatMemoryManager<T>
Implements
Inherited Members

Remarks

The pointer is assumed to be fully unmanaged, or externally pinned - no attempt will be made to pin this data

Constructors

MatMemoryManager(Mat, bool)

Create a new UnmanagedMemoryManager instance at the given pointer and size

public MatMemoryManager(Mat mat, bool isDataOwner = true)

Parameters

mat Mat
isDataOwner bool

Remarks

It is assumed that the span provided is already unmanaged or externally pinned

Methods

Dispose(bool)

Releases all resources associated with this object

protected override void Dispose(bool disposing)

Parameters

disposing bool

GetSpan()

Returns a memory span that wraps the underlying memory buffer.

public override Span<T> GetSpan()

Returns

Span<T>

A memory span that wraps the underlying memory buffer.

Pin(int)

Provides access to a pointer that represents the data (note: no actual pin occurs)

public override MemoryHandle Pin(int elementIndex = 0)

Parameters

elementIndex int

Returns

MemoryHandle

Unpin()

Has no effect

public override void Unpin()