ArrayExtensionsCast3DTFrom, TTo(ArraySegmentTFrom, Int32, Int32, Int32) Method
Reinterprets the specified
arraySegment as a three-dimensional
CastArray3DTFrom, TTo struct,
while its element type is cast from
TFrom to
TTo.
No heap allocation occurs when using this method.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static CastArray3D<TFrom, TTo> Cast3D<TFrom, TTo>(
this ArraySegment<TFrom> arraySegment,
int depth,
int height,
int width
)
where TFrom : struct, new()
where TTo : struct, new()
<ExtensionAttribute>
Public Shared Function Cast3D(Of TFrom As {Structure, New}, TTo As {Structure, New}) (
arraySegment As ArraySegment(Of TFrom),
depth As Integer,
height As Integer,
width As Integer
) As CastArray3D(Of TFrom, TTo)
public:
[ExtensionAttribute]
generic<typename TFrom, typename TTo>
where TFrom : value class, gcnew()
where TTo : value class, gcnew()
static CastArray3D<TFrom, TTo> Cast3D(
ArraySegment<TFrom> arraySegment,
int depth,
int height,
int width
)
[<ExtensionAttribute>]
static member Cast3D :
arraySegment : ArraySegment<'TFrom> *
depth : int *
height : int *
width : int -> CastArray3D<'TFrom, 'TTo> when 'TFrom : struct, new() when 'TTo : struct, new()
- arraySegment ArraySegmentTFrom
- The desired underlying buffer for the CastArray3DTFrom, TTo instance to be created.
It must have sufficient capacity for the specified dimensions.
- depth Int32
- The depth of the array to be returned.
- height Int32
- The height of the array to be returned.
- width Int32
- The width of the array to be returned.
- TFrom
- The actual element type of the specified arraySegment.
- TTo
- The reinterpreted element type after casting.
CastArray3DTFrom,
TToA
CastArray3DTFrom, TTo instance using the specified
arraySegment as its underlying buffer that has the specified dimensions.In Visual Basic and C#, you can call this method as an instance method on any object of type
ArraySegmentTFrom. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).