|
Blender V5.3
|
Namespaces | |
| namespace | blenlib_internal |
Functions | |
| template<class T, size_t N> | |
| constexpr size_t | ARRAY_SIZE (const T(&arg)[N]) noexcept |
| template<class T> | |
| constexpr std::enable_if_t< blenlib_internal::IsBoundedArray< T >::value, size_t > | BOUNDED_ARRAY_TYPE_SIZE () noexcept |
Simple Math Macros | |
| constexpr int64_t | is_power_of_2 (const int64_t x) |
| constexpr int64_t | log2_floor (const int64_t x) |
| constexpr int64_t | log2_ceil (const int64_t x) |
| constexpr int64_t | power_of_2_max (const int64_t x) |
Struct After Macros | |
Typically used to copy/clear polymorphic structs which have a generic member at the start which needs to be left as-is. | |
| constexpr bool | memory_is_zero (const void *data, const size_t size) |
| template<typename T> | |
| constexpr bool | value_is_zero_memory (const T &value) |
|
constexprnoexcept |
Size of a bounded array provided as an arg.
The arg must be a bounded array, such as int[7] or MyType[11]. Returns the number of elements in the array, known at the compile time.
Definition at line 608 of file gpencil_cache_utils.cc.
|
constexprnoexcept |
Number of elements in a type which defines a bounded array.
For example, struct MyType { int array[12]; };
BOUNDED_ARRAY_TYPE_SIZE<decltype(MyType::array)> returns 12.
Definition at line 626 of file gpencil_cache_utils.cc.
Definition at line 170 of file gpencil_cache_utils.cc.
References blender::draw::gpencil::Instance::tobjects, and blender::draw::gpencil::Instance::tobjects_infront.
Definition at line 182 of file gpencil_cache_utils.cc.
Definition at line 176 of file gpencil_cache_utils.cc.
|
constexpr |
Check if size bytes at data are all zero.
Definition at line 375 of file gpencil_cache_utils.cc.
References blender::draw::gpencil::Instance::use_mask_fb.
Definition at line 188 of file gpencil_cache_utils.cc.
|
constexpr |
Similar to memory_is_zero but is easier to see through for the compiler. This may return false even if the value is technically all zeroes in some cases, because reading from padding bits/bytes may cause undefined behavior.
This can be overloaded for custom types if an is-zero check is important for performance.
Definition at line 394 of file gpencil_cache_utils.cc.
References blender::DRW_STATE_BLEND_MUL, blender::DRW_STATE_BLEND_SUB, blender::GP_LAYER_BLEND_DIVIDE, blender::GP_LAYER_BLEND_HARDLIGHT, blender::GP_LAYER_BLEND_MULTIPLY, blender::GP_LAYER_BLEND_SUBTRACT, and state.