ReadOnlySpanExtensions.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>(ReadOnlySpan<T>, Int32, Int32) |
Returns a ReadOnlySpan2D<T> instance wrapping the underlying data for the given ReadOnlySpan<T> instance. |
AsSpan2D<T>(ReadOnlySpan<T>, Int32, Int32, Int32, Int32) |
Returns a ReadOnlySpan2D<T> instance wrapping the underlying data for the given ReadOnlySpan<T> instance. |
AsSpan2D<T>(ReadOnlySpan<T>, Int32, Int32)
Returns a ReadOnlySpan2D<T> instance wrapping the underlying data for the given ReadOnlySpan<T> instance.
public static Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<T> AsSpan2D<T> (this ReadOnlySpan<T> span, int height, int width);
static member AsSpan2D : ReadOnlySpan<'T> * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T>
<Extension()>
Public Function AsSpan2D(Of T) (span As ReadOnlySpan(Of T), height As Integer, width As Integer) As ReadOnlySpan2D(Of T)
Type Parameters
- T
The type of items in the input ReadOnlySpan<T> instance.
Parameters
- span
- ReadOnlySpan<T>
The input ReadOnlySpan<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 ReadOnlySpan2D<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>(ReadOnlySpan<T>, Int32, Int32, Int32, Int32)
Returns a ReadOnlySpan2D<T> instance wrapping the underlying data for the given ReadOnlySpan<T> instance.
public static Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<T> AsSpan2D<T> (this ReadOnlySpan<T> span, int offset, int height, int width, int pitch);
static member AsSpan2D : ReadOnlySpan<'T> * int * int * int * int -> Microsoft.Toolkit.HighPerformance.ReadOnlySpan2D<'T>
<Extension()>
Public Function AsSpan2D(Of T) (span As ReadOnlySpan(Of T), offset As Integer, height As Integer, width As Integer, pitch As Integer) As ReadOnlySpan2D(Of T)
Type Parameters
- T
The type of items in the input ReadOnlySpan<T> instance.
Parameters
- span
- ReadOnlySpan<T>
The input ReadOnlySpan<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 ReadOnlySpan2D<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
.