Modifica

Condividi tramite


SpanExtensions.AsSpan2D Method

Definition

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)

Returns a Span2D<T> instance wrapping the underlying data for the given Span<T> instance.

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

span
Span<T>

The input Span<T> instance.

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)

Returns a Span2D<T> instance wrapping the underlying data for the given Span<T> instance.

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

span
Span<T>

The input Span<T> instance.

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.

Applies to