You’re reading an older version of the Slamcore SDK documenation. The latest one is 23.04.

File range.hpp

Header file for the Range class.

Functions

inline std::ostream &operator<<(std::ostream &out, const Range1D &range)
inline std::ostream &operator<<(std::ostream &out, const Range2D &rect)
namespace slamcore

Main namespace for the Slamcore public API

Helper conversion methods

slamcore::ImageFormat \(\leftrightarrow\) BytesPerChannel

Get information about the client library

Functions

inline std::ostream &operator<<(std::ostream &out, const Range1D &range)
inline std::ostream &operator<<(std::ostream &out, const Range2D &rect)
class Range1D
#include <range.hpp>

Captures the half-open interval [min, max)

Public Types

using ValueT = int

Public Functions

Range1D() = default
inline Range1D(const ValueT min, const ValueT max)
inline ValueT min() const

Get the min value of the range.

inline ValueT max() const

Get the max value of the range.

inline Range1D expanded(ValueT point) const

Return a new Range so that the point is within the range.

inline Range1D intersection(const Range1D &other) const

Return a new range of the intersection of this range with another.

inline ValueT length() const

Get the length of the range.

inline bool empty() const

Check if the range is empty.

inline bool contains(ValueT point) const

Check if the Range contains a point.

Private Members

ValueT m_min = 0
ValueT m_max = 0

Friends

inline friend bool operator==(const Range1D &lhs, const Range1D &rhs)
inline friend bool operator!=(const Range1D &lhs, const Range1D &rhs)
class Range2D
#include <range.hpp>

Captures the half-open 2D interval [(x_min, y_min), (x_max, y_max))

Public Types

using ScalarT = Range1D::ValueT
using ValueT = Vector<ScalarT, 2>

Public Functions

Range2D() = default
inline Range2D(const ValueT min, const ValueT max)
inline ValueT min() const

Get the min value of the range.

inline ValueT max() const

Get the max value of the range.

inline Range2D expanded(const ValueT &point) const

Return a new Range so that the point is within the range.

inline Range2D intersection(const Range2D &other) const

Return a new range of the intersection of this range with another.

inline ScalarT area() const

Get the area of the 2D range.

inline bool empty() const

Check if the range is empty.

inline bool contains(const ValueT &point) const

Check if the Range contains a point.

Private Members

Range1D m_xRange
Range1D m_yRange

Friends

inline friend bool operator==(const Range2D &lhs, const Range2D &rhs)
inline friend bool operator!=(const Range2D &lhs, const Range2D &rhs)