Blender V4.3
blender::index_mask::IndexMaskSegment Class Reference

#include <BLI_index_mask.hh>

Inherits blender::OffsetSpan< int64_t, int16_t >.

Public Member Functions

#IndexMaskSegment Inline Methods
 IndexMaskSegment (const OffsetSpan< int64_t, int16_t > span)
 
IndexMaskSegment slice (const IndexRange &range) const
 
IndexMaskSegment slice (const int64_t start, const int64_t size) const
 
IndexMaskSegment shift (const int64_t shift) const
 
- Public Member Functions inherited from blender::OffsetSpan< int64_t, int16_t >
 OffsetSpan ()=default
 
 OffsetSpan (const int64_t offset, const Span< int16_t > data)
 
Span< int16_tbase_span () const
 
int64_t offset () const
 
bool is_empty () const
 
int64_t size () const
 
int64_t last (const int64_t n=0) const
 
IndexRange index_range () const
 
int64_t operator[] (const int64_t i) const
 
OffsetSpan slice (const IndexRange &range) const
 
OffsetSpan slice (const int64_t start, const int64_t size) const
 
Iterator begin () const
 
Iterator end () const
 

Detailed Description

A sequence of unique and ordered indices in one segment of an IndexMask. The segment as a whole has an int64_t index offset that is added to each referenced int16_t index.

Definition at line 124 of file BLI_index_mask.hh.

Constructor & Destructor Documentation

◆ IndexMaskSegment()

blender::index_mask::IndexMaskSegment::IndexMaskSegment ( const OffsetSpan< int64_t, int16_t > span)
inlineexplicit

Definition at line 601 of file BLI_index_mask.hh.

Referenced by shift(), slice(), and slice().

Member Function Documentation

◆ shift()

IndexMaskSegment blender::index_mask::IndexMaskSegment::shift ( const int64_t shift) const
inline

Get a new segment where each index is modified by the given amount. This works in constant time, because only the offset value is changed.

Definition at line 617 of file BLI_index_mask.hh.

References blender::OffsetSpan< int64_t, int16_t >::base_span(), BLI_assert, IndexMaskSegment(), blender::OffsetSpan< int64_t, int16_t >::is_empty(), and blender::OffsetSpan< int64_t, int16_t >::offset().

Referenced by blender::index_mask::difference_index_mask_segments(), and blender::index_mask::IndexMask::set_bits().

◆ slice() [1/2]

IndexMaskSegment blender::index_mask::IndexMaskSegment::slice ( const IndexRange & range) const
inline

◆ slice() [2/2]

IndexMaskSegment blender::index_mask::IndexMaskSegment::slice ( const int64_t start,
const int64_t size ) const
inline

Definition at line 611 of file BLI_index_mask.hh.

References IndexMaskSegment(), and slice().


The documentation for this class was generated from the following file: