Blender V5.3
blender::bke::attribute_math Namespace Reference

Namespaces

namespace  detail

Classes

class  SimpleMixer
class  BooleanPropagationMixer
class  SimpleMixerWithAccumulationType
class  ColorGeometry4fMixer
class  ColorGeometry4bMixer
class  float4x4Mixer
struct  DefaultMixerStruct
struct  DefaultMixerStruct< float >
struct  DefaultMixerStruct< float2 >
struct  DefaultMixerStruct< float3 >
struct  DefaultMixerStruct< float4 >
struct  DefaultMixerStruct< ColorGeometry4f >
struct  DefaultMixerStruct< ColorGeometry4b >
struct  DefaultMixerStruct< float4x4 >
struct  DefaultMixerStruct< int >
struct  DefaultMixerStruct< short2 >
struct  DefaultMixerStruct< int2 >
struct  DefaultMixerStruct< bool >
struct  DefaultMixerStruct< int8_t >
struct  DefaultMixerStruct< math::Quaternion >
struct  DefaultPropagationMixerStruct
struct  DefaultPropagationMixerStruct< bool >

Functions

template<typename Fn>
void to_static_type (const CPPType &cpp_type, Fn &&fn)
template<typename Fn>
void to_static_type (const bke::AttrType data_type, Fn &&fn)
template<>
math::Quaternion mix2 (const float factor, const math::Quaternion &a, const math::Quaternion &b)
template<>
math::Quaternion mix3 (const float3 &weights, const math::Quaternion &v0, const math::Quaternion &v1, const math::Quaternion &v2)
template<>
math::Quaternion mix4 (const float4 &weights, const math::Quaternion &v0, const math::Quaternion &v1, const math::Quaternion &v2, const math::Quaternion &v3)
template<>
float4x4 mix2 (const float factor, const float4x4 &a, const float4x4 &b)
template<>
float4x4 mix3 (const float3 &weights, const float4x4 &v0, const float4x4 &v1, const float4x4 &v2)
template<>
float4x4 mix4 (const float4 &weights, const float4x4 &v0, const float4x4 &v1, const float4x4 &v2, const float4x4 &v3)
template<typename T>
void mix_groups (const Span< T > src, const OffsetIndices< int > groups, const Span< int > all_indices, const IndexMask &dst_mask, MutableSpan< T > dst)
template<typename T>
void mix_groups (const Span< T > src, const OffsetIndices< int > groups, const Span< int > all_indices, const Span< float > all_weights, const IndexMask &dst_mask, MutableSpan< T > dst)
template<typename T>
void shift_left (MutableSpan< T > data, int src_begin, int src_end, int dst_begin)
template<typename T>
void shift_right (MutableSpan< T > data, int src_begin, int src_end, int dst_end)
Mix two values of the same type.

This is just basic linear interpolation.

template<typename T>
T mix2 (float factor, const T &a, const T &b)
template<>
bool mix2 (const float factor, const bool &a, const bool &b)
template<>
int8_t mix2 (const float factor, const int8_t &a, const int8_t &b)
template<>
int mix2 (const float factor, const int &a, const int &b)
template<>
short2 mix2 (const float factor, const short2 &a, const short2 &b)
template<>
int2 mix2 (const float factor, const int2 &a, const int2 &b)
template<>
float mix2 (const float factor, const float &a, const float &b)
template<>
float2 mix2 (const float factor, const float2 &a, const float2 &b)
template<>
float3 mix2 (const float factor, const float3 &a, const float3 &b)
template<>
float4 mix2 (const float factor, const float4 &a, const float4 &b)
template<>
ColorGeometry4f mix2 (const float factor, const ColorGeometry4f &a, const ColorGeometry4f &b)
template<>
ColorGeometry4b mix2 (const float factor, const ColorGeometry4b &a, const ColorGeometry4b &b)
Mix three values of the same type.

This is typically used to interpolate values within a triangle.

template<typename T>
T mix3 (const float3 &weights, const T &v0, const T &v1, const T &v2)
template<>
int8_t mix3 (const float3 &weights, const int8_t &v0, const int8_t &v1, const int8_t &v2)
template<>
bool mix3 (const float3 &weights, const bool &v0, const bool &v1, const bool &v2)
template<>
int mix3 (const float3 &weights, const int &v0, const int &v1, const int &v2)
template<>
short2 mix3 (const float3 &weights, const short2 &v0, const short2 &v1, const short2 &v2)
template<>
int2 mix3 (const float3 &weights, const int2 &v0, const int2 &v1, const int2 &v2)
template<>
float mix3 (const float3 &weights, const float &v0, const float &v1, const float &v2)
template<>
float2 mix3 (const float3 &weights, const float2 &v0, const float2 &v1, const float2 &v2)
template<>
float3 mix3 (const float3 &weights, const float3 &v0, const float3 &v1, const float3 &v2)
template<>
float4 mix3 (const float3 &weights, const float4 &v0, const float4 &v1, const float4 &v2)
template<>
ColorGeometry4f mix3 (const float3 &weights, const ColorGeometry4f &v0, const ColorGeometry4f &v1, const ColorGeometry4f &v2)
template<>
ColorGeometry4b mix3 (const float3 &weights, const ColorGeometry4b &v0, const ColorGeometry4b &v1, const ColorGeometry4b &v2)
Mix four values of the same type.
template<typename T>
T mix4 (const float4 &weights, const T &v0, const T &v1, const T &v2, const T &v3)
template<>
int8_t mix4 (const float4 &weights, const int8_t &v0, const int8_t &v1, const int8_t &v2, const int8_t &v3)
template<>
bool mix4 (const float4 &weights, const bool &v0, const bool &v1, const bool &v2, const bool &v3)
template<>
int mix4 (const float4 &weights, const int &v0, const int &v1, const int &v2, const int &v3)
template<>
short2 mix4 (const float4 &weights, const short2 &v0, const short2 &v1, const short2 &v2, const short2 &v3)
template<>
int2 mix4 (const float4 &weights, const int2 &v0, const int2 &v1, const int2 &v2, const int2 &v3)
template<>
float mix4 (const float4 &weights, const float &v0, const float &v1, const float &v2, const float &v3)
template<>
float2 mix4 (const float4 &weights, const float2 &v0, const float2 &v1, const float2 &v2, const float2 &v3)
template<>
float3 mix4 (const float4 &weights, const float3 &v0, const float3 &v1, const float3 &v2, const float3 &v3)
template<>
float4 mix4 (const float4 &weights, const float4 &v0, const float4 &v1, const float4 &v2, const float4 &v3)
template<>
ColorGeometry4f mix4 (const float4 &weights, const ColorGeometry4f &v0, const ColorGeometry4f &v1, const ColorGeometry4f &v2, const ColorGeometry4f &v3)
template<>
ColorGeometry4b mix4 (const float4 &weights, const ColorGeometry4b &v0, const ColorGeometry4b &v1, const ColorGeometry4b &v2, const ColorGeometry4b &v3)
Generic Array Utils Implementations

Extra implementations of functions from #BLI_array_utils.hh for all attribute types, used to avoid templating the same logic for each type in many places.

void shift_left (GMutableSpan data, int src_begin, int src_end, int dst_begin)
void shift_right (GMutableSpan data, int src_begin, int src_end, int dst_begin)
void gather (GSpan src, Span< int > map, GMutableSpan dst)
void gather (const GVArray &src, Span< int > map, GMutableSpan dst)
void gather (GSpan src, Span< int > map, const IndexMask &dst_mask, GMutableSpan dst)
void gather (const GVArray &src, Span< int > map, const IndexMask &dst_mask, GMutableSpan dst)
void gather_group_to_group (OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, GSpan src, GMutableSpan dst)
void gather_to_groups (OffsetIndices< int > dst_offsets, const IndexMask &src_selection, GSpan src, GMutableSpan dst)
void gather_ranges_to_groups (Span< IndexRange > src_ranges, OffsetIndices< int > dst_offsets, GSpan src, GMutableSpan dst)

Mix a dynamic amount of values with weights for many elements.

This section provides an abstraction for "mixers". The abstraction encapsulates details about how different types should be mixed. Usually DefaultMixer<T> should be used to get a mixer for a specific type.

template<typename T>
using DefaultPropagationMixer = typename DefaultPropagationMixerStruct<T>::type
template<typename T>
using DefaultMixer = typename DefaultMixerStruct<T>::type
template<typename T>
T mix_indices (const Span< T > src, const Span< int > indices)
template<typename T, typename ToAccumFn, typename ToFinalFn>
T mix_indices (const Span< T > src, const Span< int > indices, const ToAccumFn &to_accum_fn, const ToFinalFn &to_final_fn)
bool mix_indices (const Span< bool > src, const Span< int > indices)
int mix_indices (const Span< int > src, const Span< int > indices)
int2 mix_indices (const Span< int2 > src, const Span< int > indices)
int8_t mix_indices (const Span< int8_t > src, const Span< int > indices)
short2 mix_indices (const Span< short2 > src, const Span< int > indices)
math::Quaternion mix_indices (const Span< math::Quaternion > src, const Span< int > indices)
ColorGeometry4b mix_indices (const Span< ColorGeometry4b > src, const Span< int > indices)
ColorGeometry4f mix_indices (const Span< ColorGeometry4f > src, const Span< int > indices)
float4x4 mix_indices (Span< float4x4 > src, Span< int > indices)
template<typename T>
T mix_indices (const Span< T > src, const Span< int > indices, const Span< float > weights)
template<typename T, typename ToAccumFn, typename ToFinalFn>
T mix_indices (const Span< T > src, const Span< int > indices, const Span< float > weights, const ToAccumFn &to_accum_fn, const ToFinalFn &to_final_fn)
bool mix_indices (const Span< bool > src, const Span< int > indices, const Span< float > weights)
int mix_indices (const Span< int > src, const Span< int > indices, const Span< float > weights)
int2 mix_indices (const Span< int2 > src, const Span< int > indices, const Span< float > weights)
int8_t mix_indices (const Span< int8_t > src, const Span< int > indices, const Span< float > weights)
short2 mix_indices (const Span< short2 > src, const Span< int > indices, const Span< float > weights)
math::Quaternion mix_indices (const Span< math::Quaternion > src, const Span< int > indices, const Span< float > weights)
ColorGeometry4b mix_indices (const Span< ColorGeometry4b > src, const Span< int > indices, const Span< float > weights)
ColorGeometry4f mix_indices (const Span< ColorGeometry4f > src, const Span< int > indices, const Span< float > weights)
float4x4 mix_indices (Span< float4x4 > src, Span< int > indices, Span< float > weights)
void mix_groups (GSpan src, OffsetIndices< int > groups, Span< int > all_indices, std::optional< Span< float > > all_weights, GMutableSpan dst)
void mix_groups (GSpan src, OffsetIndices< int > groups, Span< int > all_indices, std::optional< Span< float > > all_weights, const IndexMask &dst_mask, GMutableSpan dst)
void mix_groups (GSpan src, OffsetIndices< int > groups, Span< int > all_indices, GMutableSpan dst)
void mix_groups (GSpan src, GroupedSpan< int > indices, GMutableSpan dst)

Typedef Documentation

◆ DefaultMixer

template<typename T>
using blender::bke::attribute_math::DefaultMixer = typename DefaultMixerStruct<T>::type

Definition at line 888 of file BKE_attribute_math.hh.

◆ DefaultPropagationMixer

This mixer is meant for propagating attributes when creating new geometry. A key difference with the default mixer is that booleans are mixed with "or" instead of "at least half" (the default mixing for booleans).

Definition at line 884 of file BKE_attribute_math.hh.

Function Documentation

◆ gather() [1/4]

void blender::bke::attribute_math::gather ( const GVArray & src,
Span< int > map,
const IndexMask & dst_mask,
GMutableSpan dst )

Definition at line 438 of file attribute_math.cc.

References gather(), T, to_static_type(), and blender::GVArrayCommon::type().

◆ gather() [2/4]

void blender::bke::attribute_math::gather ( const GVArray & src,
Span< int > map,
GMutableSpan dst )

◆ gather() [3/4]

void blender::bke::attribute_math::gather ( GSpan src,
Span< int > map,
const IndexMask & dst_mask,
GMutableSpan dst )

Definition at line 433 of file attribute_math.cc.

References blender::GVArray::from_span(), and gather().

◆ gather() [4/4]

void blender::bke::attribute_math::gather ( GSpan src,
Span< int > map,
GMutableSpan dst )

Definition at line 423 of file attribute_math.cc.

References blender::GVArray::from_span(), gather(), blender::IndexRange::IndexRange(), and blender::GMutableSpan::size().

Referenced by blender::ed::greasepencil::apply_eval_grease_pencil_data(), blender::geometry::construct::build_output_mesh(), blender::bke::SampleIndexFunction::call(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::copy_and_mix_attributes(), blender::nodes::node_geo_duplicate_elements_cc::copy_edge_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_face_attributes_without_id(), blender::geometry::create_curve_from_vert_indices(), blender::ed::curves::duplicate_points(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), gather(), gather(), gather(), gather(), blender::bke::gather_attributes(), blender::bke::gather_attributes(), blender::nodes::node_geo_extrude_mesh_cc::gather_attributes(), blender::nodes::node_geo_extrude_mesh_cc::gather_vert_attributes(), blender::bke::EvaluateAtIndexInput::get_varray_for_context(), blender::geometry::mesh_faces_to_curves_convert(), blender::geometry::mesh_triangulate(), blender::geometry::propagate_edge_attributes(), blender::geometry::propagate_vert_attributes(), blender::geometry::reorder_attribute_domain(), blender::reorder_attribute_domain(), blender::nodes::node_geo_dual_mesh_cc::transfer_attributes(), and blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes().

◆ gather_group_to_group()

◆ gather_ranges_to_groups()

void blender::bke::attribute_math::gather_ranges_to_groups ( Span< IndexRange > src_ranges,
OffsetIndices< int > dst_offsets,
GSpan src,
GMutableSpan dst )

◆ gather_to_groups()

◆ mix2() [1/14]

template<>
bool blender::bke::attribute_math::mix2 ( const float factor,
const bool & a,
const bool & b )
inline

Definition at line 66 of file BKE_attribute_math.hh.

References b, and mix2().

◆ mix2() [2/14]

template<>
ColorGeometry4b blender::bke::attribute_math::mix2 ( const float factor,
const ColorGeometry4b & a,
const ColorGeometry4b & b )
inline

Definition at line 118 of file BKE_attribute_math.hh.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [3/14]

template<>
ColorGeometry4f blender::bke::attribute_math::mix2 ( const float factor,
const ColorGeometry4f & a,
const ColorGeometry4f & b )
inline

Definition at line 112 of file BKE_attribute_math.hh.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [4/14]

template<>
float blender::bke::attribute_math::mix2 ( const float factor,
const float & a,
const float & b )
inline

Definition at line 91 of file BKE_attribute_math.hh.

References b, and mix2().

◆ mix2() [5/14]

template<>
float2 blender::bke::attribute_math::mix2 ( const float factor,
const float2 & a,
const float2 & b )
inline

Definition at line 96 of file BKE_attribute_math.hh.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [6/14]

template<>
float3 blender::bke::attribute_math::mix2 ( const float factor,
const float3 & a,
const float3 & b )
inline

Definition at line 101 of file BKE_attribute_math.hh.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [7/14]

template<>
float4 blender::bke::attribute_math::mix2 ( const float factor,
const float4 & a,
const float4 & b )
inline

Definition at line 106 of file BKE_attribute_math.hh.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [8/14]

template<>
float4x4 blender::bke::attribute_math::mix2 ( const float factor,
const float4x4 & a,
const float4x4 & b )

Definition at line 49 of file attribute_math.cc.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [9/14]

template<>
int blender::bke::attribute_math::mix2 ( const float factor,
const int & a,
const int & b )
inline

Definition at line 76 of file BKE_attribute_math.hh.

References b, and mix2().

◆ mix2() [10/14]

template<>
int2 blender::bke::attribute_math::mix2 ( const float factor,
const int2 & a,
const int2 & b )
inline

Definition at line 86 of file BKE_attribute_math.hh.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [11/14]

template<>
int8_t blender::bke::attribute_math::mix2 ( const float factor,
const int8_t & a,
const int8_t & b )
inline

Definition at line 71 of file BKE_attribute_math.hh.

References b, and mix2().

◆ mix2() [12/14]

template<>
math::Quaternion blender::bke::attribute_math::mix2 ( const float factor,
const math::Quaternion & a,
const math::Quaternion & b )

Definition at line 23 of file attribute_math.cc.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [13/14]

template<>
short2 blender::bke::attribute_math::mix2 ( const float factor,
const short2 & a,
const short2 & b )
inline

Definition at line 81 of file BKE_attribute_math.hh.

References b, blender::math::interpolate(), and mix2().

◆ mix2() [14/14]

◆ mix3() [1/14]

template<>
bool blender::bke::attribute_math::mix3 ( const float3 & weights,
const bool & v0,
const bool & v1,
const bool & v2 )
inline

Definition at line 139 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [2/14]

template<>
ColorGeometry4b blender::bke::attribute_math::mix3 ( const float3 & weights,
const ColorGeometry4b & v0,
const ColorGeometry4b & v1,
const ColorGeometry4b & v2 )
inline

◆ mix3() [3/14]

template<>
ColorGeometry4f blender::bke::attribute_math::mix3 ( const float3 & weights,
const ColorGeometry4f & v0,
const ColorGeometry4f & v1,
const ColorGeometry4f & v2 )
inline

◆ mix3() [4/14]

template<>
float blender::bke::attribute_math::mix3 ( const float3 & weights,
const float & v0,
const float & v1,
const float & v2 )
inline

Definition at line 161 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [5/14]

template<>
float2 blender::bke::attribute_math::mix3 ( const float3 & weights,
const float2 & v0,
const float2 & v1,
const float2 & v2 )
inline

Definition at line 167 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [6/14]

template<>
float3 blender::bke::attribute_math::mix3 ( const float3 & weights,
const float3 & v0,
const float3 & v1,
const float3 & v2 )
inline

Definition at line 173 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [7/14]

template<>
float4 blender::bke::attribute_math::mix3 ( const float3 & weights,
const float4 & v0,
const float4 & v1,
const float4 & v2 )
inline

Definition at line 179 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [8/14]

◆ mix3() [9/14]

template<>
int blender::bke::attribute_math::mix3 ( const float3 & weights,
const int & v0,
const int & v1,
const int & v2 )
inline

Definition at line 144 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [10/14]

template<>
int2 blender::bke::attribute_math::mix3 ( const float3 & weights,
const int2 & v0,
const int2 & v1,
const int2 & v2 )
inline

Definition at line 155 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [11/14]

template<>
int8_t blender::bke::attribute_math::mix3 ( const float3 & weights,
const int8_t & v0,
const int8_t & v1,
const int8_t & v2 )
inline

Definition at line 134 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [12/14]

template<>
math::Quaternion blender::bke::attribute_math::mix3 ( const float3 & weights,
const math::Quaternion & v0,
const math::Quaternion & v1,
const math::Quaternion & v2 )

◆ mix3() [13/14]

template<>
short2 blender::bke::attribute_math::mix3 ( const float3 & weights,
const short2 & v0,
const short2 & v1,
const short2 & v2 )
inline

Definition at line 150 of file BKE_attribute_math.hh.

References mix3(), and blender::v2.

◆ mix3() [14/14]

◆ mix4() [1/14]

template<>
bool blender::bke::attribute_math::mix4 ( const float4 & weights,
const bool & v0,
const bool & v1,
const bool & v2,
const bool & v3 )
inline

Definition at line 227 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [2/14]

template<>
ColorGeometry4b blender::bke::attribute_math::mix4 ( const float4 & weights,
const ColorGeometry4b & v0,
const ColorGeometry4b & v1,
const ColorGeometry4b & v2,
const ColorGeometry4b & v3 )
inline

◆ mix4() [3/14]

template<>
ColorGeometry4f blender::bke::attribute_math::mix4 ( const float4 & weights,
const ColorGeometry4f & v0,
const ColorGeometry4f & v1,
const ColorGeometry4f & v2,
const ColorGeometry4f & v3 )
inline

◆ mix4() [4/14]

template<>
float blender::bke::attribute_math::mix4 ( const float4 & weights,
const float & v0,
const float & v1,
const float & v2,
const float & v3 )
inline

Definition at line 256 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [5/14]

template<>
float2 blender::bke::attribute_math::mix4 ( const float4 & weights,
const float2 & v0,
const float2 & v1,
const float2 & v2,
const float2 & v3 )
inline

Definition at line 263 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [6/14]

template<>
float3 blender::bke::attribute_math::mix4 ( const float4 & weights,
const float3 & v0,
const float3 & v1,
const float3 & v2,
const float3 & v3 )
inline

Definition at line 270 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [7/14]

template<>
float4 blender::bke::attribute_math::mix4 ( const float4 & weights,
const float4 & v0,
const float4 & v1,
const float4 & v2,
const float4 & v3 )
inline

Definition at line 277 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [8/14]

template<>
float4x4 blender::bke::attribute_math::mix4 ( const float4 & weights,
const float4x4 & v0,
const float4x4 & v1,
const float4x4 & v2,
const float4x4 & v3 )

◆ mix4() [9/14]

template<>
int blender::bke::attribute_math::mix4 ( const float4 & weights,
const int & v0,
const int & v1,
const int & v2,
const int & v3 )
inline

Definition at line 234 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [10/14]

template<>
int2 blender::bke::attribute_math::mix4 ( const float4 & weights,
const int2 & v0,
const int2 & v1,
const int2 & v2,
const int2 & v3 )
inline

Definition at line 248 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [11/14]

template<>
int8_t blender::bke::attribute_math::mix4 ( const float4 & weights,
const int8_t & v0,
const int8_t & v1,
const int8_t & v2,
const int8_t & v3 )
inline

Definition at line 220 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [12/14]

template<>
math::Quaternion blender::bke::attribute_math::mix4 ( const float4 & weights,
const math::Quaternion & v0,
const math::Quaternion & v1,
const math::Quaternion & v2,
const math::Quaternion & v3 )

◆ mix4() [13/14]

template<>
short2 blender::bke::attribute_math::mix4 ( const float4 & weights,
const short2 & v0,
const short2 & v1,
const short2 & v2,
const short2 & v3 )
inline

Definition at line 240 of file BKE_attribute_math.hh.

References mix4(), and blender::v2.

◆ mix4() [14/14]

◆ mix_groups() [1/6]

template<typename T>
void blender::bke::attribute_math::mix_groups ( const Span< T > src,
const OffsetIndices< int > groups,
const Span< int > all_indices,
const IndexMask & dst_mask,
MutableSpan< T > dst )

◆ mix_groups() [2/6]

template<typename T>
void blender::bke::attribute_math::mix_groups ( const Span< T > src,
const OffsetIndices< int > groups,
const Span< int > all_indices,
const Span< float > all_weights,
const IndexMask & dst_mask,
MutableSpan< T > dst )

◆ mix_groups() [3/6]

void blender::bke::attribute_math::mix_groups ( GSpan src,
GroupedSpan< int > indices,
GMutableSpan dst )
inline

◆ mix_groups() [4/6]

void blender::bke::attribute_math::mix_groups ( GSpan src,
OffsetIndices< int > groups,
Span< int > all_indices,
GMutableSpan dst )
inline

Definition at line 905 of file BKE_attribute_math.hh.

References mix_groups().

◆ mix_groups() [5/6]

void blender::bke::attribute_math::mix_groups ( GSpan src,
OffsetIndices< int > groups,
Span< int > all_indices,
std::optional< Span< float > > all_weights,
const IndexMask & dst_mask,
GMutableSpan dst )

Mix the source values of each group into the corresponding index in the destination mask.

Parameters
groupsGroups of source indices and weights for every index in #dst_mask.

Definition at line 352 of file attribute_math.cc.

References blender::BLI_assert(), mix_groups(), blender::index_mask::IndexMask::size(), blender::offset_indices::OffsetIndices< T >::size(), blender::Span< T >::size(), T, to_static_type(), blender::offset_indices::OffsetIndices< T >::total_size(), and blender::GSpan::type().

◆ mix_groups() [6/6]

◆ mix_indices() [1/22]

bool blender::bke::attribute_math::mix_indices ( const Span< bool > src,
const Span< int > indices )
inline

Definition at line 406 of file BKE_attribute_math.hh.

References mix_indices().

◆ mix_indices() [2/22]

bool blender::bke::attribute_math::mix_indices ( const Span< bool > src,
const Span< int > indices,
const Span< float > weights )
inline

Definition at line 478 of file BKE_attribute_math.hh.

References blender::Span< T >::index_range(), and mix_indices().

◆ mix_indices() [3/22]

ColorGeometry4b blender::bke::attribute_math::mix_indices ( const Span< ColorGeometry4b > src,
const Span< int > indices )
inline

◆ mix_indices() [4/22]

ColorGeometry4b blender::bke::attribute_math::mix_indices ( const Span< ColorGeometry4b > src,
const Span< int > indices,
const Span< float > weights )
inline

◆ mix_indices() [5/22]

ColorGeometry4f blender::bke::attribute_math::mix_indices ( const Span< ColorGeometry4f > src,
const Span< int > indices )
inline

Definition at line 441 of file BKE_attribute_math.hh.

References blender::Span< T >::cast(), and mix_indices().

◆ mix_indices() [6/22]

ColorGeometry4f blender::bke::attribute_math::mix_indices ( const Span< ColorGeometry4f > src,
const Span< int > indices,
const Span< float > weights )
inline

Definition at line 527 of file BKE_attribute_math.hh.

References blender::Span< T >::cast(), and mix_indices().

◆ mix_indices() [7/22]

int blender::bke::attribute_math::mix_indices ( const Span< int > src,
const Span< int > indices )
inline

◆ mix_indices() [8/22]

int blender::bke::attribute_math::mix_indices ( const Span< int > src,
const Span< int > indices,
const Span< float > weights )
inline

◆ mix_indices() [9/22]

int2 blender::bke::attribute_math::mix_indices ( const Span< int2 > src,
const Span< int > indices )
inline

◆ mix_indices() [10/22]

int2 blender::bke::attribute_math::mix_indices ( const Span< int2 > src,
const Span< int > indices,
const Span< float > weights )
inline

◆ mix_indices() [11/22]

int8_t blender::bke::attribute_math::mix_indices ( const Span< int8_t > src,
const Span< int > indices )
inline

◆ mix_indices() [12/22]

int8_t blender::bke::attribute_math::mix_indices ( const Span< int8_t > src,
const Span< int > indices,
const Span< float > weights )
inline

◆ mix_indices() [13/22]

math::Quaternion blender::bke::attribute_math::mix_indices ( const Span< math::Quaternion > src,
const Span< int > indices )
inline

◆ mix_indices() [14/22]

math::Quaternion blender::bke::attribute_math::mix_indices ( const Span< math::Quaternion > src,
const Span< int > indices,
const Span< float > weights )
inline

◆ mix_indices() [15/22]

short2 blender::bke::attribute_math::mix_indices ( const Span< short2 > src,
const Span< int > indices )
inline

◆ mix_indices() [16/22]

short2 blender::bke::attribute_math::mix_indices ( const Span< short2 > src,
const Span< int > indices,
const Span< float > weights )
inline

◆ mix_indices() [17/22]

◆ mix_indices() [18/22]

template<typename T>
T blender::bke::attribute_math::mix_indices ( const Span< T > src,
const Span< int > indices,
const Span< float > weights )
inline

◆ mix_indices() [19/22]

template<typename T, typename ToAccumFn, typename ToFinalFn>
T blender::bke::attribute_math::mix_indices ( const Span< T > src,
const Span< int > indices,
const Span< float > weights,
const ToAccumFn & to_accum_fn,
const ToFinalFn & to_final_fn )
inline

◆ mix_indices() [20/22]

template<typename T, typename ToAccumFn, typename ToFinalFn>
T blender::bke::attribute_math::mix_indices ( const Span< T > src,
const Span< int > indices,
const ToAccumFn & to_accum_fn,
const ToFinalFn & to_final_fn )
inline

◆ mix_indices() [21/22]

◆ mix_indices() [22/22]

◆ shift_left() [1/2]

void blender::bke::attribute_math::shift_left ( GMutableSpan data,
int src_begin,
int src_end,
int dst_begin )

Move elements from [src_begin, src_end) to dest_begin. dest_begin must be <= src_begin.

Definition at line 401 of file attribute_math.cc.

References blender::data, shift_left(), T, and to_static_type().

Referenced by blender::ed::greasepencil::resize_single_curve(), shift_left(), shift_left(), and blender::ed::sculpt_paint::greasepencil::trim_end_points().

◆ shift_left() [2/2]

template<typename T>
void blender::bke::attribute_math::shift_left ( MutableSpan< T > data,
int src_begin,
int src_end,
int dst_begin )

Definition at line 393 of file attribute_math.cc.

References blender::data, ELEM, and shift_left().

◆ shift_right() [1/2]

void blender::bke::attribute_math::shift_right ( GMutableSpan data,
int src_begin,
int src_end,
int dst_begin )

Move elements from [src_begin, src_end) to a range ending at dst_end. dst_end must be >= src_end.

Definition at line 416 of file attribute_math.cc.

References blender::data, shift_right(), T, and to_static_type().

Referenced by blender::ed::greasepencil::add_single_curve(), blender::ed::greasepencil::resize_single_curve(), shift_right(), and shift_right().

◆ shift_right() [2/2]

template<typename T>
void blender::bke::attribute_math::shift_right ( MutableSpan< T > data,
int src_begin,
int src_end,
int dst_end )

Definition at line 408 of file attribute_math.cc.

References blender::data, ELEM, and shift_right().

◆ to_static_type() [1/2]

template<typename Fn>
void blender::bke::attribute_math::to_static_type ( const bke::AttrType data_type,
Fn && fn )
inline

◆ to_static_type() [2/2]

template<typename Fn>
void blender::bke::attribute_math::to_static_type ( const CPPType & cpp_type,
Fn && fn )
inline

Utility function that simplifies calling a templated function based on a run-time data type.

Definition at line 35 of file BKE_attribute_math.hh.

References float, T, to_static_type(), and blender::CPPType::to_static_type().

Referenced by blender::bke::adapt_curve_domain_point_to_curve(), blender::bke::adapt_mesh_domain_corner_to_edge(), blender::bke::adapt_mesh_domain_corner_to_face(), blender::bke::adapt_mesh_domain_corner_to_point(), blender::bke::adapt_mesh_domain_edge_to_corner(), blender::bke::adapt_mesh_domain_edge_to_face(), blender::bke::adapt_mesh_domain_edge_to_point(), blender::bke::adapt_mesh_domain_face_to_edge(), blender::bke::adapt_mesh_domain_face_to_point(), blender::bke::adapt_mesh_domain_point_to_corner(), blender::bke::adapt_mesh_domain_point_to_edge(), blender::bke::adapt_mesh_domain_point_to_face(), attr_create_generic(), attr_create_generic(), blender::draw::pbvh::calc_generic_corner_attribute_grids(), blender::draw::pbvh::calc_generic_vert_attribute_grids(), blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction::call(), blender::AttrSingleValueChecker::check_range(), copy_attributes(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::bke::copy_curve_domain_attribute_to_mesh(), blender::bke::copy_main_point_domain_attribute_to_mesh(), blender::bke::copy_profile_point_domain_attribute_to_mesh(), blender::ed::greasepencil::boolean::create_curves_from_segments(), blender::io::alembic::create_geom_param_for_attribute(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), blender::draw::extract_attribute_data(), blender::draw::extract_attribute_subdiv(), blender::draw::extract_data_bmesh(), blender::draw::pbvh::fill_generic_face_attribute_grids(), gather(), gather_group_to_group(), gather_ranges_to_groups(), gather_to_groups(), blender::geometry::gaussian_blur_1D(), blender::draw::init_format_for_attribute(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::bke::curves::bezier::interpolate_to_evaluated(), blender::bke::curves::catmull_rom::interpolate_to_evaluated(), blender::bke::curves::catmull_rom::interpolate_to_evaluated(), blender::bke::curves::nurbs::interpolate_to_evaluated(), blender::bke::mesh_flip_faces(), blender::bke::LegacyMeshInterpolator::mix(), blender::geometry::mix(), blender::geometry::mix_arrays(), blender::geometry::mix_arrays(), blender::bke::subdiv::mix_attrs(), blender::bke::subdiv::mix_attrs(), blender::bke::subdiv::mix_attrs(), mix_groups(), blender::geometry::mix_with_indices(), blender::nodes::node_geo_grid_info_cc::node_geo_exec(), blender::nodes::node_geo_grid_to_points_cc::node_geo_exec(), blender::geometry::resample_to_uniform(), blender::bke::CurvesGeometry::reverse_curves(), blender::bke::mesh_surface_sample::sample_corner_attribute(), blender::geometry::sample_curve_attribute(), blender::bke::mesh_surface_sample::sample_face_attribute(), blender::bke::mesh_surface_sample::sample_point_attribute(), blender::ed::curves::set_attribute_invoke(), blender::ed::pointcloud::set_attribute_invoke(), shift_left(), shift_right(), blender::geometry::subdivide_attribute_linear(), to_static_type(), to_static_type(), blender::geometry::trim_attribute_linear(), blender::geometry::trim_catmull_rom_curves(), blender::geometry::trim_evaluated_curves(), blender::draw::pbvh::update_generic_attribute_bmesh(), blender::draw::pbvh::update_generic_attribute_mesh(), and blender::draw::vertbuf_data_extract_direct().