Blender V5.3
blender::array_utils Namespace Reference

Enumerations

enum class  BooleanMix { None , AllFalse , AllTrue , Mixed }

Functions

constexpr int64_t calc_copy_grain_size (const exec_mode::Tag auto mode, const int64_t type_size)
constexpr int64_t calc_copy_grain_size (const exec_mode::Mode mode, const int64_t type_size)
template<exec_mode::Tag Mode>
constexpr auto exec_mode_tag_for_copy (const Mode mode, const int64_t type_size)
void copy (const GVArray &src, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void copy (const VArray< T > &src, MutableSpan< T > dst, const Mode mode={})
template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void copy (const Span< T > src, MutableSpan< T > dst, const Mode mode={})
void copy (const GVArray &src, const IndexMask &selection, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void copy (const Span< T > src, const IndexMask &selection, MutableSpan< T > dst, const Mode mode={})
template<typename T>
T compute_sum (const Span< T > data)
template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void scatter (const Span< T > src, const Span< IndexT > indices, MutableSpan< T > dst, const Mode mode={})
template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void scatter (const Span< T > src, const IndexMask &indices, MutableSpan< T > dst, const Mode mode={})
void gather (const GVArray &src, const IndexMask &indices, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
void gather (GSpan src, const IndexMask &indices, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void gather (const VArray< T > &src, const IndexMask &indices, MutableSpan< T > dst, const Mode mode={})
template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void gather (const Span< T > src, const Span< IndexT > indices, const IndexMask &dst_mask, MutableSpan< T > dst, const Mode mode={})
template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void gather (const Span< T > src, const Span< IndexT > indices, MutableSpan< T > dst, const Mode mode={})
template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void gather (const VArray< T > &src, const Span< IndexT > indices, const IndexMask &dst_mask, MutableSpan< T > dst, const Mode mode={})
template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void gather (const VArray< T > &src, const Span< IndexT > indices, MutableSpan< T > dst, const Mode mode={})
template<typename T>
void gather_group_to_group (const OffsetIndices< int > src_offsets, const OffsetIndices< int > dst_offsets, const IndexMask &selection, const Span< T > src, MutableSpan< T > dst)
template<typename T>
void gather_group_to_group (const OffsetIndices< int > src_offsets, const OffsetIndices< int > dst_offsets, const Span< int > selection, const Span< T > src, MutableSpan< T > dst)
template<typename T>
void gather_group_to_group (const OffsetIndices< int > src_offsets, const OffsetIndices< int > dst_offsets, const IndexMask &selection, const VArray< T > src, MutableSpan< T > dst)
template<typename T>
void gather_to_groups (const OffsetIndices< int > dst_offsets, const IndexMask &src_selection, const Span< T > src, MutableSpan< T > dst)
void copy_group_to_group (OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, GSpan src, GMutableSpan dst)
template<typename T>
void copy_group_to_group (OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, Span< T > src, MutableSpan< T > dst)
void count_indices (Span< int > indices, MutableSpan< int > counts)
int group_ids_to_indices (Span< int > ids, const IndexMask &mask, MutableSpan< int > r_group_indices, Vector< int > *r_first_indices=nullptr)
void invert_booleans (MutableSpan< bool > span)
void invert_booleans (MutableSpan< bool > span, const IndexMask &mask)
int64_t count_booleans (const VArray< bool > &varray)
int64_t count_booleans (const VArray< bool > &varray, const IndexMask &mask)
BooleanMix booleans_mix_calc (const VArray< bool > &varray, IndexRange range_to_check)
BooleanMix booleans_mix_calc (const VArray< bool > &varray)
bool contains (const VArray< bool > &varray, const IndexMask &indices_to_check, bool value)
IndexMask indices_non_negative (const IndexMask &universe, Span< int > values, LinearAllocator<> &memory)
IndexMask indices_in_range (const IndexMask &universe, Span< int > values, IndexRange range, LinearAllocator<> &memory)
template<typename T>
Vector< IndexRange > find_all_ranges (const Span< T > span, const T &value)
template<typename T>
void fill_index_range (MutableSpan< T > span, const T start=0)
template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void fill_index_range (const IndexMask &mask, MutableSpan< T > span, const Mode mode={})
template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void fill_index_range (const IndexMask &mask, MutableSpan< T > span, const T start, const Mode mode={})
template<typename T>
bool indexed_data_equal (const Span< T > all_values, const Span< int > indices, const Span< T > values)
bool indices_are_range (Span< int > indices, IndexRange range)
template<typename T>
std::optional< int64_t > max_element_index (const Span< T > &span, const int64_t grain_size=8192)
template<typename T>
std::optional< int64_t > max_element_index (const VArray< T > &array, const int64_t grain_size=8192)
static void count_indices_serial (const Span< int > indices, MutableSpan< int > counts)
static void count_indices_atomics (const Span< int > indices, MutableSpan< int > counts)
static void count_indices_thread_local (const Span< int > indices, MutableSpan< int > counts, const int64_t max_threads)
static int count_indices_with_table (const Span< int > ids, const IndexMask &mask, const Bounds< int > &id_bounds, MutableSpan< int > r_group_indices, Vector< int > *r_first_indices)
static bool all_equal (const Span< bool > span, const bool test)
static bool all_equal (const VArray< bool > &varray, const IndexRange range, const bool test)

Enumeration Type Documentation

◆ BooleanMix

Enumerator
None 
AllFalse 
AllTrue 
Mixed 

Definition at line 380 of file BLI_array_utils.hh.

Function Documentation

◆ all_equal() [1/2]

bool blender::array_utils::all_equal ( const Span< bool > span,
const bool test )
static

◆ all_equal() [2/2]

bool blender::array_utils::all_equal ( const VArray< bool > & varray,
const IndexRange range,
const bool test )
static

◆ booleans_mix_calc() [1/2]

BooleanMix blender::array_utils::booleans_mix_calc ( const VArray< bool > & varray)
inline

◆ booleans_mix_calc() [2/2]

◆ calc_copy_grain_size() [1/2]

int64_t blender::array_utils::calc_copy_grain_size ( const exec_mode::Mode mode,
const int64_t type_size )
constexpr

◆ calc_copy_grain_size() [2/2]

int64_t blender::array_utils::calc_copy_grain_size ( const exec_mode::Tag auto mode,
const int64_t type_size )
constexpr

Definition at line 26 of file BLI_array_utils.hh.

References calc_copy_grain_size().

Referenced by calc_copy_grain_size(), calc_copy_grain_size(), copy(), copy(), and gather().

◆ compute_sum()

◆ contains()

◆ copy() [1/5]

◆ copy() [2/5]

void blender::array_utils::copy ( const GVArray & src,
GMutableSpan dst,
exec_mode::Mode mode = exec_mode::parallel )

Fill the destination span by copying all values from the src array.

Definition at line 27 of file array_utils.cc.

References blender::BLI_assert(), calc_copy_grain_size(), copy(), blender::GMutableSpan::data(), blender::Default, blender::GVArrayCommon::index_range(), blender::exec_mode::Mode::is_parallel, blender::GVArrayCommon::materialize(), blender::threading::parallel_for(), PRF_scope_with_name, blender::CPPType::size, blender::GMutableSpan::size(), blender::GVArrayCommon::size(), blender::GMutableSpan::type(), and blender::GVArrayCommon::type().

Referenced by blender::bke::build_mesh_positions(), blender::geometry::construct::build_output_mesh(), copy(), copy(), copy(), copy(), copy(), blender::ed::curves::copy_data_to_geometry(), blender::create_envelope_strokes(), blender::bke::Attribute::data_for_write(), blender::ed::sculpt_paint::face_set::duplicate_face_sets(), blender::ed::curves::duplicate_points(), blender::ed::pointcloud::duplicate_points(), blender::draw::GSplatEvalCache::ensure_attribute(), blender::fn::evaluate_fields(), blender::geometry::execute_instances_tasks(), blender::draw::extract_edge_index_mesh(), blender::draw::extract_face_dot_index(), blender::draw::extract_vert_index_mesh(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::gpu::VertBuf::from_span(), blender::gpu::VertBuf::from_varray(), blender::bke::subdiv::gather_manifold_sharpness(), blender::get_factor_from_draw_speed(), blender::nodes::node_geo_input_cluster_by_connected_cc::ClusterByConnectedFieldInput::get_varray_for_context(), blender::GPU_indexbuf_build_from_memory(), blender::ed::greasepencil::grease_pencil_primitive_load(), blender::ed::greasepencil::grease_pencil_primitive_save(), blender::draw::grease_pencil_weight_batch_ensure(), blender::ed::sculpt_paint::hide::grow_shrink_visibility_mesh(), blender::io::csv::import_csv_as_pointcloud(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::geometry::interpolate_curves_with_samples(), blender::ed::object::mesh_data_to_grease_pencil(), blender::bke::mesh_select_edge_flush(), blender::bke::mesh_select_face_flush(), blender::bke::mesh_select_vert_flush(), blender::draw::pointcloud_extract_attribute(), blender::geometry::remove_points_and_split(), blender::geometry::resample_to_count(), blender::geometry::sort_indices_by_weights(), blender::ed::geometry::store_attributes_to_shape_keys(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::stl::STLMeshHelper::to_mesh(), blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes(), and blender::bke::try_capture_fields_on_geometry().

◆ copy() [3/5]

template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::copy ( const Span< T > src,
const IndexMask & selection,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Fill the destination span by copying values from the src array.

Definition at line 99 of file BLI_array_utils.hh.

References copy().

◆ copy() [4/5]

template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::copy ( const Span< T > src,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Fill the destination span by copying all values from the src array.

Definition at line 73 of file BLI_array_utils.hh.

References copy().

◆ copy() [5/5]

template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::copy ( const VArray< T > & src,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Definition at line 55 of file BLI_array_utils.hh.

References copy().

◆ copy_group_to_group() [1/2]

◆ copy_group_to_group() [2/2]

template<typename T>
void blender::array_utils::copy_group_to_group ( OffsetIndices< int > src_offsets,
OffsetIndices< int > dst_offsets,
const IndexMask & selection,
Span< T > src,
MutableSpan< T > dst )

Definition at line 341 of file BLI_array_utils.hh.

References copy_group_to_group().

◆ count_booleans() [1/2]

◆ count_booleans() [2/2]

◆ count_indices()

void blender::array_utils::count_indices ( Span< int > indices,
MutableSpan< int > counts )

◆ count_indices_atomics()

void blender::array_utils::count_indices_atomics ( const Span< int > indices,
MutableSpan< int > counts )
static

◆ count_indices_serial()

void blender::array_utils::count_indices_serial ( const Span< int > indices,
MutableSpan< int > counts )
static

Definition at line 102 of file array_utils.cc.

References count_indices_serial().

Referenced by count_indices(), and count_indices_serial().

◆ count_indices_thread_local()

void blender::array_utils::count_indices_thread_local ( const Span< int > indices,
MutableSpan< int > counts,
const int64_t max_threads )
static

◆ count_indices_with_table()

int blender::array_utils::count_indices_with_table ( const Span< int > ids,
const IndexMask & mask,
const Bounds< int > & id_bounds,
MutableSpan< int > r_group_indices,
Vector< int > * r_first_indices )
static

A lookup table indexed by the IDs avoids hashing and can be filled in parallel, which makes it much faster than a hash table, but the size of the table depends on the range of the IDs, so still use a VectorSet instead of the lookup table would need to be too large.

Definition at line 195 of file array_utils.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), count_indices_with_table(), blender::index_mask::IndexMask::foreach_index_optimized(), blender::IndexMask::from_predicate(), blender::exec_mode::grain_size(), blender::Bounds< T >::max, blender::Bounds< T >::min, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::index_mask::IndexMask::size(), and blender::index_mask::IndexMask::to_indices().

Referenced by count_indices_with_table(), and group_ids_to_indices().

◆ exec_mode_tag_for_copy()

template<exec_mode::Tag Mode>
auto blender::array_utils::exec_mode_tag_for_copy ( const Mode mode,
const int64_t type_size )
constexpr

Similar to #Mode::grain_size(int), but also returns a tag type.

Definition at line 40 of file BLI_array_utils.hh.

References exec_mode_tag_for_copy().

Referenced by exec_mode_tag_for_copy().

◆ fill_index_range() [1/3]

template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::fill_index_range ( const IndexMask & mask,
MutableSpan< T > span,
const Mode mode = {} )
inline

Definition at line 440 of file BLI_array_utils.hh.

References fill_index_range().

◆ fill_index_range() [2/3]

template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::fill_index_range ( const IndexMask & mask,
MutableSpan< T > span,
const T start,
const Mode mode = {} )
inline

Definition at line 446 of file BLI_array_utils.hh.

References fill_index_range(), and T.

◆ fill_index_range() [3/3]

template<typename T>
void blender::array_utils::fill_index_range ( MutableSpan< T > span,
const T start = 0 )
inline

Fill the span with increasing indices: 0, 1, 2, ... Optionally, the start value can be provided.

Definition at line 434 of file BLI_array_utils.hh.

References blender::MutableSpan< T >::begin(), blender::MutableSpan< T >::end(), fill_index_range(), and T.

Referenced by blender::tests::all_indices(), blender::apply_weights_vertex_normal(), blender::BKE_mesh_legacy_convert_polys_to_offsets(), blender::BLI_scanfill_calc_ex(), blender::bpy_bmelemseq_sort(), blender::geometry::build_point_to_sample_map(), blender::build_relax_phases(), blender::io::obj::OBJMesh::calc_face_order(), blender::bke::node_structure_type_inferencing::calc_node_interface(), blender::ed::sculpt_paint::cloth::calc_vert_indices_grids(), blender::geometry::calculate_cone_faces(), blender::bke::compute_local_mesh_groups(), blender::geometry::construct::compute_new_corner_interp_weights(), blender::nodes::node_geo_mesh_primitive_circle_cc::create_circle_mesh(), blender::ed::greasepencil::create_connected_edges_from_fill(), blender::create_dashes(), blender::nodes::node_geo_duplicate_elements_cc::create_duplicate_index_attribute(), blender::create_envelope_strokes(), blender::ed::greasepencil::segment::create_segments_from_intersections_single_curve(), blender::bke::tests::GreasePencilInterpolate::create_test_curves(), blender::geometry::tests::create_test_curves(), blender::geometry::tests::create_test_curves(), blender::nodes::node_geo_points_to_curves_cc::curve_from_points(), blender::ed::greasepencil::curve_merge_by_distance(), blender::draw::overlay::GreasePencil::draw_grease_pencil(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::ensure_orig_index_layer(), blender::draw::extract_face_dot_index(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), fill_index_range(), fill_index_range(), fill_index_range(), blender::geometry::find_collapsed_and_weld_edges(), blender::ed::sculpt_paint::greasepencil::find_curve_mapping_from_index(), blender::geometry::fit_poly_to_bezier_curves(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::bke::pbvh::Tree::from_grids(), blender::bke::pbvh::Tree::from_mesh(), blender::bke::greasepencil::gather_next_available_fill_ids(), blender::io::ply::generate_vertex_map(), blender::ed::greasepencil::get_gapless_indices(), blender::ed::greasepencil::get_reordered_indices(), blender::nodes::node_geo_cluster_by_distance_cc::ClusterByDistanceFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::PointsOfCurveInput::get_varray_for_context(), blender::nodes::node_geo_input_shortest_edge_paths_cc::ShortestEdgePathsNextVertFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_edge_cc::CornersOfEdgeInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_face_cc::CornersOfFaceInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_vertex_cc::CornersOfVertInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_vertex_cc::EdgesOfVertInput::get_varray_for_context(), blender::draw::grease_pencil_geom_batch_ensure(), blender::geometry::grease_pencil_remove_points_and_split(), blender::geometry::identifiers_to_indices(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::ed::transform::make_sorted_index_map(), blender::material_slot_move_exec(), blender::bke::mesh_calc_edges(), blender::bke::mesh_calc_modifiers(), blender::geometry::mesh_merge_by_distance_connected(), blender::geometry::mesh_merge_verts(), blender::mesh_remove_doubles_on_axis(), blender::modify_mesh(), blender::multires_unsubdivide_add_original_index_datalayers(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), blender::reorder_cyclic_curve_points(), blender::index_mask::segments_from_batch_predicate(), blender::bke::greasepencil::shapes_from_fill_ids(), blender::geometry::sort_indices_by_weights(), blender::ed::sculpt_paint::tests::TEST_F(), blender::ed::sculpt_paint::tests::TEST_F(), and blender::bke::Instances::unique_ids().

◆ find_all_ranges()

◆ gather() [1/7]

void blender::array_utils::gather ( const GVArray & src,
const IndexMask & indices,
GMutableSpan dst,
exec_mode::Mode mode = exec_mode::parallel )

Fill the destination span by gathering indexed values from the src array.

Definition at line 63 of file array_utils.cc.

References blender::BLI_assert(), calc_copy_grain_size(), blender::GMutableSpan::data(), blender::Default, gather(), blender::index_mask::IndexMask::index_range(), blender::exec_mode::Mode::is_parallel, blender::GVArrayCommon::materialize_compressed(), blender::threading::parallel_for(), PRF_scope_with_name, blender::CPPType::size, blender::GMutableSpan::size(), blender::index_mask::IndexMask::size(), blender::GMutableSpan::type(), and blender::GVArrayCommon::type().

Referenced by blender::nodes::node_geo_duplicate_elements_cc::accumulate_counts_to_offsets(), blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::ed::transform::curves::append_positions_to_custom_data(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::geometry::construct::build_output_mesh(), blender::nodes::node_geo_extrude_mesh_cc::build_vert_to_edge_map(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::geometry::copy_and_reorder_instaces(), blender::geometry::copy_and_reorder_mesh_edges(), blender::geometry::copy_and_reorder_mesh_verts(), blender::geometry::create_merged_mesh(), blender::ed::transform::pointcloud::createTransPointCloudVerts(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::curves_copy_point_selection(), blender::ed::curves::duplicate_curves(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::ed::pointcloud::duplicate_points(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::geometry::execute_instances_tasks(), blender::draw::extract_edge_index_mesh(), blender::draw::extract_sculpt_data_subdiv(), blender::draw::extract_vert_idx_loose_geom_subdiv(), blender::draw::extract_vert_index_mesh(), blender::draw::extract_vert_normals_mesh(), blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_vertices(), blender::nodes::node_geo_filter_list_cc::filter_list(), gather(), gather(), gather(), gather(), gather(), gather(), gather(), blender::bke::gather_attributes(), blender::nodes::node_geo_extrude_mesh_cc::gather_attributes(), blender::ed::sculpt_paint::gather_data_mesh(), blender::nodes::node_geo_scale_elements_cc::gather_edge_islands(), blender::nodes::node_geo_scale_elements_cc::gather_face_islands(), blender::bke::subdiv::gather_manifold_sharpness(), blender::nodes::node_geo_extrude_mesh_cc::gather_vert_attributes(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), blender::nodes::node_geo_index_of_nearest_cc::IndexOfNearestFieldInput::get_varray_for_context(), blender::draw::grease_pencil_cache_add_nurbs(), blender::draw::grease_pencil_edit_batch_ensure(), blender::ed::sculpt_paint::grease_pencil_fill_extension_lines_from_circles(), blender::bke::subdiv::initialize_manifold_indices(), blender::geometry::join_instances(), blender::geometry::merge_points(), blender::geometry::merge_propagation_map(), blender::bke::mesh_calc_edges(), blender::ed::object::mesh_data_to_grease_pencil(), blender::geometry::mesh_edges_to_curves_convert(), blender::geometry::mesh_triangulate(), blender::nodes::node_geo_attribute_statistic_cc::node_geo_exec(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_sort_list_cc::node_geo_exec(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::geometry::propagate_edge_attributes(), blender::geometry::propagate_vert_attributes(), blender::bke::remove_invalid_edges(), blender::bke::remove_invalid_faces(), blender::geometry::sort_indices_by_weights(), blender::ed::sculpt_paint::expand::spherical_falloff_create(), blender::io::obj::OBJMesh::store_normal_coords_and_indices(), blender::ed::sculpt_paint::boundary::twist_data_init_grids(), blender::ed::sculpt_paint::boundary::twist_data_init_mesh(), blender::bke::greasepencil::update_triangle_and_offsets_changed(), and blender::bke::mesh::vert_tris_from_corner_tris().

◆ gather() [2/7]

template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::gather ( const Span< T > src,
const Span< IndexT > indices,
const IndexMask & dst_mask,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Fill the destination span by gathering indexed values from the src array.

Definition at line 210 of file BLI_array_utils.hh.

References gather().

◆ gather() [3/7]

template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::gather ( const Span< T > src,
const Span< IndexT > indices,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Fill the destination span by gathering indexed values from the src array.

Definition at line 226 of file BLI_array_utils.hh.

References gather().

◆ gather() [4/7]

template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::gather ( const VArray< T > & src,
const IndexMask & indices,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Fill the destination span by gathering indexed values from the src array.

Definition at line 188 of file BLI_array_utils.hh.

References gather().

◆ gather() [5/7]

template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::gather ( const VArray< T > & src,
const Span< IndexT > indices,
const IndexMask & dst_mask,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Fill the destination span by gathering indexed values from the src array.

Definition at line 238 of file BLI_array_utils.hh.

References gather().

◆ gather() [6/7]

template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::gather ( const VArray< T > & src,
const Span< IndexT > indices,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Fill the destination span by gathering indexed values from the src array.

Definition at line 269 of file BLI_array_utils.hh.

References gather().

◆ gather() [7/7]

void blender::array_utils::gather ( GSpan src,
const IndexMask & indices,
GMutableSpan dst,
exec_mode::Mode mode = exec_mode::parallel )

Fill the destination span by gathering indexed values from the src array.

Definition at line 82 of file array_utils.cc.

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

◆ gather_group_to_group() [1/3]

◆ gather_group_to_group() [2/3]

template<typename T>
void blender::array_utils::gather_group_to_group ( const OffsetIndices< int > src_offsets,
const OffsetIndices< int > dst_offsets,
const IndexMask & selection,
const VArray< T > src,
MutableSpan< T > dst )
inline

◆ gather_group_to_group() [3/3]

template<typename T>
void blender::array_utils::gather_group_to_group ( const OffsetIndices< int > src_offsets,
const OffsetIndices< int > dst_offsets,
const Span< int > selection,
const Span< T > src,
MutableSpan< T > dst )
inline

◆ gather_to_groups()

◆ group_ids_to_indices()

int blender::array_utils::group_ids_to_indices ( Span< int > ids,
const IndexMask & mask,
MutableSpan< int > r_group_indices,
Vector< int > * r_first_indices = nullptr )

◆ indexed_data_equal()

◆ indices_are_range()

◆ indices_in_range()

IndexMask blender::array_utils::indices_in_range ( const IndexMask & universe,
Span< int > values,
IndexRange range,
LinearAllocator<> & memory )

◆ indices_non_negative()

◆ invert_booleans() [1/2]

◆ invert_booleans() [2/2]

void blender::array_utils::invert_booleans ( MutableSpan< bool > span,
const IndexMask & mask )

Definition at line 280 of file array_utils.cc.

References blender::Default, invert_booleans(), and PRF_scope_with_name.

◆ max_element_index() [1/2]

template<typename T>
std::optional< int64_t > blender::array_utils::max_element_index ( const Span< T > & span,
const int64_t grain_size = 8192 )
inline

◆ max_element_index() [2/2]

template<typename T>
std::optional< int64_t > blender::array_utils::max_element_index ( const VArray< T > & array,
const int64_t grain_size = 8192 )
inline

◆ scatter() [1/2]

template<typename T, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::scatter ( const Span< T > src,
const IndexMask & indices,
MutableSpan< T > dst,
const Mode mode = {} )
inline

Definition at line 156 of file BLI_array_utils.hh.

References scatter().

◆ scatter() [2/2]

template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel>
void blender::array_utils::scatter ( const Span< T > src,
const Span< IndexT > indices,
MutableSpan< T > dst,
const Mode mode = {} )
inline