Blender  V3.3
Classes | Namespaces | Macros | Typedefs | Functions
BLI_math_vec_types.hh File Reference
#include <array>
#include <cmath>
#include <iostream>
#include <type_traits>
#include "BLI_utildefines.h"

Go to the source code of this file.

Classes

struct  blender::vec_struct_base< T, Size >
 
struct  blender::vec_struct_base< T, 2 >
 
struct  blender::vec_struct_base< T, 3 >
 
struct  blender::vec_struct_base< T, 4 >
 
struct  blender::vec_base< T, Size >
 

Namespaces

 blender
 
 blender::math
 

Macros

#define BLI_ENABLE_IF_VEC(_size, _test)   int S = _size, BLI_ENABLE_IF((S _test))
 
#define BLI_INT_OP(_T)   template<typename U = _T, BLI_ENABLE_IF((std::is_integral_v<U>))>
 
#define BLI_VEC_OP_IMPL(_result, _i, _op)
 
#define BLI_VEC_OP_IMPL_SELF(_i, _op)
 

Typedefs

template<typename T >
using blender::as_uint_type = std::conditional_t< sizeof(T)==sizeof(uint8_t), uint8_t, std::conditional_t< sizeof(T)==sizeof(uint16_t), uint16_t, std::conditional_t< sizeof(T)==sizeof(uint32_t), uint32_t, std::conditional_t< sizeof(T)==sizeof(uint64_t), uint64_t, void > >> >
 
using blender::int2 = vec_base< int32_t, 2 >
 
using blender::int3 = vec_base< int32_t, 3 >
 
using blender::int4 = vec_base< int32_t, 4 >
 
using blender::uint2 = vec_base< uint32_t, 2 >
 
using blender::uint3 = vec_base< uint32_t, 3 >
 
using blender::uint4 = vec_base< uint32_t, 4 >
 
using blender::ushort2 = vec_base< uint16_t, 2 >
 
using blender::float2 = vec_base< float, 2 >
 
using blender::float3 = vec_base< float, 3 >
 
using blender::float4 = vec_base< float, 4 >
 
using blender::double2 = vec_base< double, 2 >
 
using blender::double3 = vec_base< double, 3 >
 
using blender::double4 = vec_base< double, 4 >
 

Functions

template<typename T >
uint64_t blender::math::vector_hash (const T &vec)
 

Macro Definition Documentation

◆ BLI_ENABLE_IF_VEC

#define BLI_ENABLE_IF_VEC (   _size,
  _test 
)    int S = _size, BLI_ENABLE_IF((S _test))

Definition at line 103 of file BLI_math_vec_types.hh.

◆ BLI_INT_OP

#define BLI_INT_OP (   _T)    template<typename U = _T, BLI_ENABLE_IF((std::is_integral_v<U>))>

Internal Operators Macro.

Definition at line 251 of file BLI_math_vec_types.hh.

◆ BLI_VEC_OP_IMPL

#define BLI_VEC_OP_IMPL (   _result,
  _i,
  _op 
)
Value:
vec_base _result; \
for (int _i = 0; _i < Size; _i++) { \
_op; \
} \
return _result;

Definition at line 253 of file BLI_math_vec_types.hh.

◆ BLI_VEC_OP_IMPL_SELF

#define BLI_VEC_OP_IMPL_SELF (   _i,
  _op 
)
Value:
for (int _i = 0; _i < Size; _i++) { \
_op; \
} \
return *this;

Definition at line 260 of file BLI_math_vec_types.hh.