Bearbeiten

Freigeben über


Span2D<T> Struct

Definition

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

Type Parameters

T
Inheritance
Span2D<T>

Constructors

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

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

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

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

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

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

Span2D<T>(T[,])

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

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

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

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

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

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

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

Properties

Empty

Gets an empty Span2D<T> instance.

Height

Gets the height of the underlying 2D memory area.

IsEmpty

Gets a value indicating whether the current Span2D<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 Span2D<T> instance.

Width

Gets the width of the underlying 2D memory area.

Methods

Clear()

Clears the contents of the current Span2D<T> instance.

CopyTo(Span<T>)

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

CopyTo(Span2D<T>)

Copies the contents of this Span2D<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 Span2D<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.

Fill(T)

Fills the elements of this span with a specified value.

GetColumn(Int32)

Gets an enumerable that traverses items in a specified column.

GetEnumerator()

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

GetHashCode()
Obsolete.

Returns the hash code for this instance.

GetPinnableReference()

Returns a reference to the 0th element of the Span2D<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 Span<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 Span2D<T> instance to a destination Span<T>.

TryCopyTo(Span2D<T>)

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

TryGetSpan(Span<T>)

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

Operators

Equality(Span2D<T>, Span2D<T>)

Checks whether two Span2D<T> instances are equal.

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

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

Applies to