Back to FabImage Library website
You are here: Start » Function Reference » All Functions » Array Transforms » RotateArray
This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.
Header: | STD.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Cyclically shifts the elements of an array.
Syntax
void fil::RotateArray ( const ftl::Array<Type>& inArray, int inShift, const bool inInverse, ftl::Array<Type>& outArray )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inArray | const Array<Type>& | Input array | |
![]() |
inShift | int | Input the number of positions each element should be shifted by | |
![]() |
inInverse | const bool | Determines if the indices are counted from beginning or from end of the input array | |
![]() |
outArray | Array<Type>& | Cyclically shifted array |
Description
The operation moves each of the inArray elements forward by inShift positions. Whenever the resulting index exceeds the size of the array, it cycles back to the beginning of the array.
Examples
![]() |
![]() |
inArray = {1,2,3,4,5,6,7} inShift = 2 |
outArray = {6,7,1,2,3,4,5} |
See Also
- SlideArray – Creates two copies of the input array - one with elements removed at the beginning, the other with elements removed at the end.
- ReverseArray – Creates an array of the input array elements in reversed order.
- SwapArrayElements – Swaps two elements of an array.