Blender V5.0
blender::bits::detail Namespace Reference

Functions

template<typename ExprFn, typename FirstBitSpanT, typename... BitSpanT>
void mix_into_first_expr (ExprFn &&expr, const FirstBitSpanT &first_arg, const BitSpanT &...args)
template<typename ExprFn, typename FirstBitSpanT, typename... BitSpanT>
bool any_set_expr (ExprFn &&expr, const FirstBitSpanT &first_arg, const BitSpanT &...args)
template<typename ExprFn, typename HandleFn, typename FirstBitSpanT, typename... BitSpanT>
void foreach_1_index_expr (ExprFn &&expr, HandleFn &&handle, const FirstBitSpanT &first_arg, const BitSpanT &...args)
template<typename ExprFn, typename FirstBitSpanT, typename... BitSpanT>
std::optional< int64_tfind_first_1_index_expr (ExprFn &&expr, const FirstBitSpanT &first_arg, const BitSpanT &...args)

Function Documentation

◆ any_set_expr()

template<typename ExprFn, typename FirstBitSpanT, typename... BitSpanT>
bool blender::bits::detail::any_set_expr ( ExprFn && expr,
const FirstBitSpanT & first_arg,
const BitSpanT &... args )
inline

Evaluates the expression on one or more bit spans and returns true when the result contains a 1 anywhere.

The expected type for the expression is: (BitInt ...one_or_more_args) -> BitInt

Definition at line 71 of file BLI_bit_span_ops.hh.

References blender::bits::all_bounded_spans, BLI_assert, i, mask(), blender::bits::mask_first_n_bits(), result, and size().

Referenced by blender::bits::any_set_expr().

◆ find_first_1_index_expr()

template<typename ExprFn, typename FirstBitSpanT, typename... BitSpanT>
std::optional< int64_t > blender::bits::detail::find_first_1_index_expr ( ExprFn && expr,
const FirstBitSpanT & first_arg,
const BitSpanT &... args )
inline

Definition at line 199 of file BLI_bit_span_ops.hh.

References foreach_1_index_expr(), i, and result.

Referenced by blender::bits::find_first_1_index_expr().

◆ foreach_1_index_expr()

template<typename ExprFn, typename HandleFn, typename FirstBitSpanT, typename... BitSpanT>
void blender::bits::detail::foreach_1_index_expr ( ExprFn && expr,
HandleFn && handle,
const FirstBitSpanT & first_arg,
const BitSpanT &... args )
inline

Evaluates the expression on one or more bit spans and calls the handle function for each bit index where the result is 1.

The expected type for the expression is: (BitInt ...one_or_more_args) -> BitInt

Definition at line 121 of file BLI_bit_span_ops.hh.

References blender::bits::all_bounded_spans, bitscan_forward_uint64(), blender::bits::BitToIntIndexShift, BLI_assert, i, blender::bits::mask_first_n_bits(), blender::bits::mask_single_bit(), result, and size().

Referenced by find_first_1_index_expr(), and blender::bits::foreach_1_index_expr().

◆ mix_into_first_expr()

template<typename ExprFn, typename FirstBitSpanT, typename... BitSpanT>
void blender::bits::detail::mix_into_first_expr ( ExprFn && expr,
const FirstBitSpanT & first_arg,
const BitSpanT &... args )
inline

Evaluates the expression on one or more bit spans and stores the result in the first.

The expected type for the expression is: (BitInt ...one_or_more_args) -> BitInt

Definition at line 25 of file BLI_bit_span_ops.hh.

References blender::bits::all_bounded_spans, BLI_assert, i, mask(), blender::bits::mask_range_bits(), result, and size().

Referenced by blender::bits::mix_into_first_expr().