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
-
IMemoryOwner<T>
- 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
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
disposingbool
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
elementIndexint
Returns
Unpin()
Has no effect
public override void Unpin()