Blender V4.3
blender::offset_indices Namespace Reference

Namespaces

namespace  tests
 

Classes

struct  GroupedSpan
 
struct  NoSortCheck
 
class  OffsetIndices
 

Functions

OffsetIndices< intaccumulate_counts_to_offsets (MutableSpan< int > counts_to_offsets, int start_offset=0)
 
std::optional< OffsetIndices< int > > accumulate_counts_to_offsets_with_overflow_check (MutableSpan< int > counts_to_offsets, int start_offset=0)
 
void fill_constant_group_size (int size, int start_offset, MutableSpan< int > offsets)
 
void copy_group_sizes (OffsetIndices< int > offsets, const IndexMask &mask, MutableSpan< int > sizes)
 
void gather_group_sizes (OffsetIndices< int > offsets, const IndexMask &mask, MutableSpan< int > sizes)
 
void gather_group_sizes (OffsetIndices< int > offsets, Span< int > indices, MutableSpan< int > sizes)
 
int sum_group_sizes (OffsetIndices< int > offsets, const IndexMask &mask)
 
int sum_group_sizes (OffsetIndices< int > offsets, Span< int > indices)
 
OffsetIndices< intgather_selected_offsets (OffsetIndices< int > src_offsets, const IndexMask &selection, int start_offset, MutableSpan< int > dst_offsets)
 
OffsetIndices< intgather_selected_offsets (OffsetIndices< int > src_offsets, const IndexMask &selection, MutableSpan< int > dst_offsets)
 
void build_reverse_map (OffsetIndices< int > offsets, MutableSpan< int > r_map)
 
void build_reverse_offsets (Span< int > indices, MutableSpan< int > offsets)
 

Function Documentation

◆ accumulate_counts_to_offsets()

OffsetIndices< int > blender::offset_indices::accumulate_counts_to_offsets ( MutableSpan< int > counts_to_offsets,
int start_offset = 0 )

◆ accumulate_counts_to_offsets_with_overflow_check()

std::optional< OffsetIndices< int > > blender::offset_indices::accumulate_counts_to_offsets_with_overflow_check ( MutableSpan< int > counts_to_offsets,
int start_offset = 0 )

◆ build_reverse_map()

void blender::offset_indices::build_reverse_map ( OffsetIndices< int > offsets,
MutableSpan< int > r_map )

Create a map from indexed elements to the source indices, in other words from the larger array to the smaller array.

Definition at line 139 of file offset_indices.cc.

References blender::offset_indices::OffsetIndices< T >::index_range().

Referenced by blender::bke::CurvesGeometry::point_to_curve_map().

◆ build_reverse_offsets()

◆ copy_group_sizes()

◆ fill_constant_group_size()

void blender::offset_indices::fill_constant_group_size ( int size,
int start_offset,
MutableSpan< int > offsets )

◆ gather_group_sizes() [1/2]

void blender::offset_indices::gather_group_sizes ( OffsetIndices< int > offsets,
const IndexMask & mask,
MutableSpan< int > sizes )

◆ gather_group_sizes() [2/2]

void blender::offset_indices::gather_group_sizes ( OffsetIndices< int > offsets,
Span< int > indices,
MutableSpan< int > sizes )

◆ gather_selected_offsets() [1/2]

◆ gather_selected_offsets() [2/2]

OffsetIndices< int > blender::offset_indices::gather_selected_offsets ( OffsetIndices< int > src_offsets,
const IndexMask & selection,
MutableSpan< int > dst_offsets )
inline

Definition at line 174 of file BLI_offset_indices.hh.

References gather_selected_offsets().

◆ sum_group_sizes() [1/2]

int blender::offset_indices::sum_group_sizes ( OffsetIndices< int > offsets,
const IndexMask & mask )

Calculate the total size of all the referenced groups.

Definition at line 106 of file offset_indices.cc.

References count, blender::offset_indices::OffsetIndices< T >::size(), and sum_group_sizes().

Referenced by blender::points_info_sequential(), sum_group_sizes(), sum_group_sizes(), and blender::offset_indices::tests::TEST().

◆ sum_group_sizes() [2/2]

int blender::offset_indices::sum_group_sizes ( OffsetIndices< int > offsets,
Span< int > indices )