OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | List of all members
otb::Interval Class Reference

#include <otbInterval.h>

Public Types

using IndexType = itk::IndexValueType
 
using SizeType = itk::SizeValueType
 

Public Member Functions

constexpr Interval (IndexType l, IndexType u) noexcept
 
IndexType m_lower
 
IndexType m_upper
 
constexpr SizeType size () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr IndexType lower () const noexcept
 
constexpr IndexType upper () const noexcept
 
static constexpr Interval OfLength (IndexType low, SizeType len) noexcept
 
constexpr friend Interval intersect (Interval const &lhs, Interval const &rhs) noexcept
 
std::ostream & operator<< (std::ostream &os, Interval const &v)
 

Detailed Description

Simplified index interval. Inspired by boost::numeric::interval.

Invariant
Can be empty.
lower <= upper
Author
Luc Hermitte (CS Group)

Definition at line 40 of file otbInterval.h.

Member Typedef Documentation

◆ IndexType

using otb::Interval::IndexType = itk::IndexValueType

Definition at line 43 of file otbInterval.h.

◆ SizeType

using otb::Interval::SizeType = itk::SizeValueType

Definition at line 44 of file otbInterval.h.

Constructor & Destructor Documentation

◆ Interval()

constexpr otb::Interval::Interval ( IndexType  l,
IndexType  u 
)
inlineconstexprnoexcept

Init constructor from the pair of its extremities.

Definition at line 47 of file otbInterval.h.

Member Function Documentation

◆ empty()

constexpr bool otb::Interval::empty ( ) const
inlineconstexprnoexcept

Alternate factory function from a position and a length.

Definition at line 64 of file otbInterval.h.

References m_lower, and m_upper.

◆ lower()

constexpr IndexType otb::Interval::lower ( ) const
inlineconstexprnoexcept

Alternate factory function from a position and a length.

Definition at line 67 of file otbInterval.h.

References m_lower.

◆ OfLength()

static constexpr Interval otb::Interval::OfLength ( IndexType  low,
SizeType  len 
)
inlinestaticconstexprnoexcept

Alternate factory function from a position and a length.

Definition at line 56 of file otbInterval.h.

References otb::details::len().

◆ size()

constexpr SizeType otb::Interval::size ( ) const
inlineconstexprnoexcept

Alternate factory function from a position and a length.

Definition at line 61 of file otbInterval.h.

References m_lower, and m_upper.

◆ upper()

constexpr IndexType otb::Interval::upper ( ) const
inlineconstexprnoexcept

Alternate factory function from a position and a length.

Definition at line 70 of file otbInterval.h.

References m_upper.

Friends And Related Function Documentation

◆ intersect

constexpr friend Interval intersect ( Interval const &  lhs,
Interval const &  rhs 
)
friend

Computes the intersection between two intervals.

Returns
their intersection
{0,0} if they don't intersect.
Note
this function is an hidden friend

Definition at line 79 of file otbInterval.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
Interval const &  v 
)
friend

Stream inserter for intervals.

Note
this function is an hidden friend

Definition at line 99 of file otbInterval.h.

Member Data Documentation

◆ m_lower

IndexType otb::Interval::m_lower
private

Alternate factory function from a position and a length.

Definition at line 105 of file otbInterval.h.

Referenced by empty(), lower(), and size().

◆ m_upper

IndexType otb::Interval::m_upper
private

Alternate factory function from a position and a length.

Definition at line 106 of file otbInterval.h.

Referenced by empty(), size(), and upper().


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