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

GetOptimalWrap

Determines whether to return standard Wrap/Reflect or bitwise optimized WrapPow2/ReflectPow2.

Declarations ​

pascal
function GetOptimalWrap(Max: Integer): TWrapProc; overload;
function GetOptimalWrap(Min, Max: Integer): TWrapProcEx; overload;
Overload Details

Overload 1 ​

pascal
function GetOptimalWrap(Max: Integer): TWrapProc; overload;

Returns optimal TWrapProc delegate for range [0..Max].

ParameterTypeDescription
MaxIntegerUpper range boundary.
TypeDescription
TWrapProcWrap procedure delegate (Wrap or WrapPow2).

Overload 2 ​

pascal
function GetOptimalWrap(Min, Max: Integer): TWrapProcEx; overload;

Returns optimal TWrapProcEx delegate for range [Min..Max].

ParameterTypeDescription
MinIntegerLower range boundary.
MaxIntegerUpper range boundary.
TypeDescription
TWrapProcExWrap procedure delegate (Wrap or WrapPow2).

Description ​

GetOptimalWrap tests whether the length of the given range (Max + 1 or Max - Min + 1) is a power of two. If so, it returns the fast bitwise WrapPow2 function delegate; otherwise, it returns standard Wrap.

See also ​