Blender V4.3
blender::bounds Namespace Reference

Functions

template<typename T >
Bounds< Tmerge (const Bounds< T > &a, const Bounds< T > &b)
 
template<typename T >
std::optional< Bounds< T > > merge (const std::optional< Bounds< T > > &a, const std::optional< Bounds< T > > &b)
 
template<typename T >
std::optional< Bounds< T > > min_max (const std::optional< Bounds< T > > &a, const T &b)
 
template<typename T >
std::optional< Bounds< T > > min_max (const Span< T > values)
 
template<typename T >
std::optional< Bounds< T > > min_max (const IndexMask &mask, const Span< T > values)
 
template<typename T , typename RadiusT >
std::optional< Bounds< T > > min_max_with_radii (const Span< T > values, const Span< RadiusT > radii)
 
template<typename T >
std::optional< Bounds< T > > intersect (const std::optional< Bounds< T > > &a, const std::optional< Bounds< T > > &b)
 

Function Documentation

◆ intersect()

template<typename T >
std::optional< Bounds< T > > blender::bounds::intersect ( const std::optional< Bounds< T > > & a,
const std::optional< Bounds< T > > & b )
inlinenodiscard

Returns a new bound that contains the intersection of the two given bound. Returns no box if there are no overlap.

Definition at line 135 of file BLI_bounds.hh.

References b, blender::math::max(), blender::math::min(), and result.

Referenced by blender::eevee::VolumeLayer::bounds_overlaps().

◆ merge() [1/2]

◆ merge() [2/2]

template<typename T >
std::optional< Bounds< T > > blender::bounds::merge ( const std::optional< Bounds< T > > & a,
const std::optional< Bounds< T > > & b )
inlinenodiscard

Definition at line 30 of file BLI_bounds.hh.

References b, and merge().

◆ min_max() [1/3]

template<typename T >
std::optional< Bounds< T > > blender::bounds::min_max ( const IndexMask & mask,
const Span< T > values )
inlinenodiscard

Definition at line 79 of file BLI_bounds.hh.

References init(), min_max(), blender::threading::parallel_reduce(), and result.

◆ min_max() [2/3]

template<typename T >
std::optional< Bounds< T > > blender::bounds::min_max ( const Span< T > values)
inlinenodiscard

Find the smallest and largest values element-wise in the span.

Definition at line 58 of file BLI_bounds.hh.

◆ min_max() [3/3]

◆ min_max_with_radii()

template<typename T , typename RadiusT >
std::optional< Bounds< T > > blender::bounds::min_max_with_radii ( const Span< T > values,
const Span< RadiusT > radii )
inlinenodiscard

Find the smallest and largest values element-wise in the span, adding the radius to each element first. The template type T is expected to have an addition operator implemented with RadiusT.

Definition at line 107 of file BLI_bounds.hh.

References BLI_assert, init(), and min_max_with_radii().

Referenced by min_max_with_radii(), and blender::tests::TEST().