SpanExtensions.AsSpan2D Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AsSpan2D<T>(Span<T>, Int32, Int32) |
Returns a Span2D<T> instance wrapping the underlying data for the given Span<T> instance. |
AsSpan2D<T>(Span<T>, Int32, Int32, Int32, Int32) |
Returns a Span2D<T> instance wrapping the underlying data for the given Span<T> instance. |
AsSpan2D<T>(Span<T>, Int32, Int32)
public static Microsoft.Toolkit.HighPerformance.Span2D<T> AsSpan2D<T> (this Span<T> span, int height, int width);
static member AsSpan2D : Span<'T> * int * int -> Microsoft.Toolkit.HighPerformance.Span2D<'T>
<Extension()>
Public Function AsSpan2D(Of T) (span As Span(Of T), height As Integer, width As Integer) As Span2D(Of T)
Type Parameters
- T
The type of items in the input Span<T> instance.
Parameters
- height
- Int32
The height of the resulting 2D area.
- width
- Int32
The width of each row in the resulting 2D area.
Returns
The resulting Span2D<T> instance.
Exceptions
Thrown when one of the input parameters is out of range.
Thrown when the requested area is outside of bounds for span
.
Applies to
AsSpan2D<T>(Span<T>, Int32, Int32, Int32, Int32)
public static Microsoft.Toolkit.HighPerformance.Span2D<T> AsSpan2D<T> (this Span<T> span, int offset, int height, int width, int pitch);
static member AsSpan2D : Span<'T> * int * int * int * int -> Microsoft.Toolkit.HighPerformance.Span2D<'T>
<Extension()>
Public Function AsSpan2D(Of T) (span As Span(Of T), offset As Integer, height As Integer, width As Integer, pitch As Integer) As Span2D(Of T)
Type Parameters
- T
The type of items in the input Span<T> instance.
Parameters
- offset
- Int32
The initial offset within span
.
- height
- Int32
The height of the resulting 2D area.
- width
- Int32
The width of each row in the resulting 2D area.
- pitch
- Int32
The pitch in the resulting 2D area.
Returns
The resulting Span2D<T> instance.
Exceptions
Thrown when one of the input parameters is out of range.
Thrown when the requested area is outside of bounds for span
.