Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_LowLevel🞂ReflectFunction

Reflect

Constrains an integer coordinate to a range with edge-pixel reflection symmetry.

Declarations ​

pascal
function Reflect(Value, Max: Integer): Integer; overload;
function Reflect(Value, Min, Max: Integer): Integer; overload;
Overload Details

Overload 1 ​

pascal
function Reflect(Value, Max: Integer): Integer; overload;

Reflects an integer value in range [0..Max].

ParameterTypeDescription
ValueIntegerInteger value to reflect.
MaxIntegerInclusive upper bound.
TypeDescription
IntegerReflected integer coordinate in range [0..Max].

Overload 2 ​

pascal
function Reflect(Value, Min, Max: Integer): Integer; overload;

Reflects an integer value in range [Min..Max].

ParameterTypeDescription
ValueIntegerInteger value to reflect.
MinIntegerInclusive lower bound.
MaxIntegerInclusive upper bound.
TypeDescription
IntegerReflected integer coordinate in range [Min..Max].

Description ​

Reflect constrains Value to range [0..Max] (or [Min..Max]) using symmetry around the outer edge of boundary pixels (cycle length 2×(Max+1)).

For example, for Max = 3, the sequence of values generated across coordinate space is: 0, 1, 2, 3, 3, 2, 1, 0, 0, 1, 2, 3, 3, 2, 1, 0.

See also ​