Blender V4.3
BKE_attribute_math.hh File Reference

Go to the source code of this file.

Classes

class  blender::bke::attribute_math::SimpleMixer< T >
 
class  blender::bke::attribute_math::BooleanPropagationMixer
 
class  blender::bke::attribute_math::SimpleMixerWithAccumulationType< T, AccumulationT, ValueToAccumulate, AccumulateToValue >
 
class  blender::bke::attribute_math::ColorGeometry4fMixer
 
class  blender::bke::attribute_math::ColorGeometry4bMixer
 
class  blender::bke::attribute_math::float4x4Mixer
 
struct  blender::bke::attribute_math::DefaultMixerStruct< T >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< float >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< float2 >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< float3 >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< ColorGeometry4f >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< ColorGeometry4b >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< float4x4 >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< int >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< int2 >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< bool >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< int8_t >
 
struct  blender::bke::attribute_math::DefaultMixerStruct< math::Quaternion >
 
struct  blender::bke::attribute_math::DefaultPropagationMixerStruct< T >
 
struct  blender::bke::attribute_math::DefaultPropagationMixerStruct< bool >
 

Namespaces

namespace  blender
 
namespace  blender::bke
 
namespace  blender::bke::attribute_math
 

Typedefs

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 blender::bke::attribute_math::DefaultPropagationMixer = typename DefaultPropagationMixerStruct<T>::type
 
template<typename T >
using blender::bke::attribute_math::DefaultMixer = typename DefaultMixerStruct<T>::type
 

Functions

template<typename Func >
void blender::bke::attribute_math::convert_to_static_type (const CPPType &cpp_type, const Func &func)
 
template<typename Func >
void blender::bke::attribute_math::convert_to_static_type (const eCustomDataType data_type, const Func &func)
 
Mix two values of the same type.

This is just basic linear interpolation.

template<typename T >
T blender::bke::attribute_math::mix2 (float factor, const T &a, const T &b)
 
template<>
bool blender::bke::attribute_math::mix2 (const float factor, const bool &a, const bool &b)
 
template<>
int8_t blender::bke::attribute_math::mix2 (const float factor, const int8_t &a, const int8_t &b)
 
template<>
int blender::bke::attribute_math::mix2 (const float factor, const int &a, const int &b)
 
template<>
int2 blender::bke::attribute_math::mix2 (const float factor, const int2 &a, const int2 &b)
 
template<>
float blender::bke::attribute_math::mix2 (const float factor, const float &a, const float &b)
 
template<>
float2 blender::bke::attribute_math::mix2 (const float factor, const float2 &a, const float2 &b)
 
template<>
float3 blender::bke::attribute_math::mix2 (const float factor, const float3 &a, const float3 &b)
 
template<>
ColorGeometry4f blender::bke::attribute_math::mix2 (const float factor, const ColorGeometry4f &a, const ColorGeometry4f &b)
 
template<>
ColorGeometry4b blender::bke::attribute_math::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 blender::bke::attribute_math::mix3 (const float3 &weights, const T &v0, const T &v1, const T &v2)
 
template<>
int8_t blender::bke::attribute_math::mix3 (const float3 &weights, const int8_t &v0, const int8_t &v1, const int8_t &v2)
 
template<>
bool blender::bke::attribute_math::mix3 (const float3 &weights, const bool &v0, const bool &v1, const bool &v2)
 
template<>
int blender::bke::attribute_math::mix3 (const float3 &weights, const int &v0, const int &v1, const int &v2)
 
template<>
int2 blender::bke::attribute_math::mix3 (const float3 &weights, const int2 &v0, const int2 &v1, const int2 &v2)
 
template<>
float blender::bke::attribute_math::mix3 (const float3 &weights, const float &v0, const float &v1, const float &v2)
 
template<>
float2 blender::bke::attribute_math::mix3 (const float3 &weights, const float2 &v0, const float2 &v1, const float2 &v2)
 
template<>
float3 blender::bke::attribute_math::mix3 (const float3 &weights, const float3 &v0, const float3 &v1, const float3 &v2)
 
template<>
ColorGeometry4f blender::bke::attribute_math::mix3 (const float3 &weights, const ColorGeometry4f &v0, const ColorGeometry4f &v1, const ColorGeometry4f &v2)
 
template<>
ColorGeometry4b blender::bke::attribute_math::mix3 (const float3 &weights, const ColorGeometry4b &v0, const ColorGeometry4b &v1, const ColorGeometry4b &v2)
 
Mix four values of the same type.
template<typename T >
T blender::bke::attribute_math::mix4 (const float4 &weights, const T &v0, const T &v1, const T &v2, const T &v3)
 
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)
 
template<>
bool blender::bke::attribute_math::mix4 (const float4 &weights, const bool &v0, const bool &v1, const bool &v2, const bool &v3)
 
template<>
int blender::bke::attribute_math::mix4 (const float4 &weights, const int &v0, const int &v1, const int &v2, const int &v3)
 
template<>
int2 blender::bke::attribute_math::mix4 (const float4 &weights, const int2 &v0, const int2 &v1, const int2 &v2, const int2 &v3)
 
template<>
float blender::bke::attribute_math::mix4 (const float4 &weights, const float &v0, const float &v1, const float &v2, const float &v3)
 
template<>
float2 blender::bke::attribute_math::mix4 (const float4 &weights, const float2 &v0, const float2 &v1, const float2 &v2, const float2 &v3)
 
template<>
float3 blender::bke::attribute_math::mix4 (const float4 &weights, const float3 &v0, const float3 &v1, const float3 &v2, const float3 &v3)
 
template<>
ColorGeometry4f blender::bke::attribute_math::mix4 (const float4 &weights, const ColorGeometry4f &v0, const ColorGeometry4f &v1, const ColorGeometry4f &v2, const ColorGeometry4f &v3)
 
template<>
ColorGeometry4b blender::bke::attribute_math::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 blender::bke::attribute_math::gather (GSpan src, Span< int > map, GMutableSpan dst)
 
void blender::bke::attribute_math::gather (const GVArray &src, Span< int > map, GMutableSpan dst)
 
void blender::bke::attribute_math::gather_group_to_group (OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, GSpan src, GMutableSpan dst)
 
void blender::bke::attribute_math::gather_to_groups (OffsetIndices< int > dst_offsets, const IndexMask &src_selection, GSpan src, GMutableSpan dst)