Skip to content

Commit

Permalink
Fix: shimat#1698 fix length of Mat.AsSpan()
Browse files Browse the repository at this point in the history
  • Loading branch information
truebigsand committed Sep 12, 2024
1 parent ca1f608 commit 3a8eefc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/OpenCvSharp/Modules/core/Mat/Mat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4161,8 +4161,8 @@ public void ForEachAsVec6d(MatForeachFunctionVec6d operation)
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public unsafe Span<T> AsSpan<T>() where T : unmanaged
=> IsContinuous() ? new Span<T>(DataPointer, (int)Total()) : [];
public unsafe Span<T> AsSpan<T>() where T : unmanaged
=> IsContinuous() ? new Span<T>(DataPointer, (int)Total() * ElemSize() / sizeof(T)) : [];

#endregion
}

0 comments on commit 3a8eefc

Please sign in to comment.