CastArray3DTFrom, TToGetElementReference Method
Gets the reference to the element at the specified indices. Parameter order is the same as in case of a regular three-dimensional array.
Namespace: KGySoft.CollectionsAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.5.0
public ref TTo GetElementReference(
int z,
int y,
int x
)
Public Function GetElementReference (
z As Integer,
y As Integer,
x As Integer
) As TTo
public:
TTo% GetElementReference(
int z,
int y,
int x
)
member GetElementReference :
z : int *
y : int *
x : int -> 'TTo
- z Int32
- The Z-coordinate (depth index) of the item to get the reference for.
- y Int32
- The Y-coordinate (row index) of the item to get the reference for.
- x Int32
- The X-coordinate (column index) of the item to get the reference for.
TToThe reference to the element at the specified coordinates.
Though this method does not validate the coordinates separately, it does not allow indexing beyond the Length of the underlying Buffer.
To allow getting any item in the actual underlying array use the GetElementReferenceUnsafe method instead.
If
TTo is a primitive type of size larger than 1 byte, and the executing architecture does not support misaligned memory access,
a
DataMisalignedException can be thrown in the moment of dereferencing the result if it its address is not properly aligned.
This method returns a value by reference. If this library is used by an older compiler that does not support such members,
use the
indexer instead.