ReadOnlySpan2D<T> Struct

Definition

public readonly ref struct ReadOnlySpan2D<T>
type ReadOnlySpan2D<'T> = struct
Public Structure ReadOnlySpan2D(Of T)

Type Parameters

T
Inheritance
ReadOnlySpan2D<T>

Constructors

ReadOnlySpan2D<T>(T[,,], Int32, Int32, Int32, Int32, Int32)

Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a layer in a 3D array.

ReadOnlySpan2D<T>(T[,,], Int32)

Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a layer in a 3D array.

ReadOnlySpan2D<T>(T[,], Int32, Int32, Int32, Int32)

Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a 2D array.

ReadOnlySpan2D<T>(T[,])

Initializes a new instance of the ReadOnlySpan2D<T> struct wrapping a 2D array.

ReadOnlySpan2D<T>(T[], Int32, Int32, Int32, Int32)

Initializes a new instance of the ReadOnlySpan2D<T> struct.

ReadOnlySpan2D<T>(T[], Int32, Int32)

Initializes a new instance of the ReadOnlySpan2D<T> struct.

ReadOnlySpan2D<T>(Void*, Int32, Int32, Int32)

Initializes a new instance of the ReadOnlySpan2D<T> struct with the specified parameters.

Properties

Empty

Gets an empty ReadOnlySpan2D<T> instance.

Height

Gets the height of the underlying 2D memory area.

IsEmpty

Gets a value indicating whether the current ReadOnlySpan2D<T> instance is empty.

Item[Index, Index]

Gets the element at the specified zero-based indices.

Item[Int32, Int32]

Gets the element at the specified zero-based indices.

Item[Range, Range]

Slices the current instance with the specified parameters.

Length

Gets the length of the current ReadOnlySpan2D<T> instance.

Width

Gets the width of the underlying 2D memory area.

Methods

CopyTo(Span<T>)

Copies the contents of this ReadOnlySpan2D<T> into a destination Span<T> instance.

CopyTo(Span2D<T>)

Copies the contents of this ReadOnlySpan2D<T> into a destination Span2D<T> instance. For this API to succeed, the target Span2D<T> has to have the same shape as the current one.

DangerousCreate(T, Int32, Int32, Int32)

Creates a new instance of the ReadOnlySpan2D<T> struct with the specified parameters.

DangerousGetReference()

Returns a reference to the first element within the current instance, with no bounds check.

DangerousGetReferenceAt(Int32, Int32)

Returns a reference to a specified element within the current instance, with no bounds check.

Equals(Object)
Obsolete.

Indicates whether this instance and a specified object are equal.

GetColumn(Int32)

Gets an enumerable that traverses items in a specified column.

GetEnumerator()

Returns an enumerator for the current ReadOnlySpan2D<T> instance.

GetHashCode()
Obsolete.

Returns the hash code for this instance.

GetPinnableReference()

Returns a reference to the 0th element of the ReadOnlySpan2D<T> instance. If the current instance is empty, returns a null reference. It can be used for pinning and is required to support the use of span within a fixed statement.

GetRow(Int32)

Gets an enumerable that traverses items in a specified row.

GetRowSpan(Int32)

Gets a ReadOnlySpan<T> for a specified row.

Slice(Int32, Int32, Int32, Int32)

Slices the current instance with the specified parameters.

ToArray()

Copies the contents of the current Span2D<T> instance into a new 2D array.

ToString()

Returns the fully qualified type name of this instance.

TryCopyTo(Span<T>)

Attempts to copy the current ReadOnlySpan2D<T> instance to a destination Span<T>.

TryCopyTo(Span2D<T>)

Attempts to copy the current ReadOnlySpan2D<T> instance to a destination Span2D<T>.

TryGetSpan(ReadOnlySpan<T>)

Tries to get a ReadOnlySpan<T> instance, if the underlying buffer is contiguous and small enough.

Operators

Equality(ReadOnlySpan2D<T>, ReadOnlySpan2D<T>)

Checks whether two ReadOnlySpan2D<T> instances are equal.

Implicit(Span2D<T> to ReadOnlySpan2D<T>)
Implicit(T[,] to ReadOnlySpan2D<T>)
Inequality(ReadOnlySpan2D<T>, ReadOnlySpan2D<T>)

Checks whether two ReadOnlySpan2D<T> instances are not equal.

Applies to