Back to Adaptive Vision Library website

You are here: Start » Function Reference » Array Basics » AvsFilter_GetArrayElement

AvsFilter_GetArrayElement


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Extracts a single element from an array at the specified index.

Syntax

void avs::AvsFilter_GetArrayElement
(
	const atl::Array<Type>& inArray,
	int inIndex,
	bool inInverse,
	Type& outValue
)

Parameters

Name Type Range Default Description
inArray const Array<Type>& Input array
inIndex int 0 - Index within the array
inInverse bool False Reversed order in the array
outValue Type& Element from the array

Hints

  • Make sure that inIndex will always be in range. If this cannot be guaranteed, use AvsFilter_GetArrayElement_OrNil instead.
  • To get the last element of a non-empty array use inIndex = 0 and inInverse = True.

Examples

inArray = {1,4,3,2,5}
inIndex = 3
inInverse = False
outValue = 2

inArray = {1,4,3,2,5}
inIndex = 3
inInverse = True
outValue = 4

Errors

Error type Description
DomainError Negative index in GetArrayElement.
DomainError Index out of range in GetArrayElement.

See Also

SetArrayElement