ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
reusex::utils Namespace Reference

Functions

const cv::Mat & get_glasbey_lut ()
template<typename T>
constexpr T deg_to_rad (T degrees)
 Convert degrees to radians.
template<typename T>
constexpr T rad_to_deg (T radians)
 Convert radians to degrees.
template<typename T>
T remap (const T value, const T min_in, const T max_in, const T min_out=T(0), T max_out=T(1))
template<typename T>
std::optional< T > parse_number (std::string_view s, std::size_t *consumed=nullptr)
 Parse a number at the start of s, after optional whitespace and a '+' (strtod accepts both; from_chars does not).
double to_double (std::string_view s, std::size_t *pos=nullptr)
 std::stod's contract without its locale: throws std::invalid_argument when s does not start with a number; pos gets the characters used.
float to_float (std::string_view s, std::size_t *pos=nullptr)
 std::stof's contract without its locale.

Function Documentation

◆ deg_to_rad()

template<typename T>
T reusex::utils::deg_to_rad ( T degrees)
inlineconstexpr

Convert degrees to radians.

Definition at line 12 of file math.hpp.

References deg_to_rad().

Referenced by deg_to_rad().

◆ get_glasbey_lut()

const cv::Mat & reusex::utils::get_glasbey_lut ( )

References get_glasbey_lut().

Referenced by get_glasbey_lut().

◆ parse_number()

template<typename T>
std::optional< T > reusex::utils::parse_number ( std::string_view s,
std::size_t * consumed = nullptr )

Parse a number at the start of s, after optional whitespace and a '+' (strtod accepts both; from_chars does not).

Sets consumed to the characters used (0 when there is no number). Out-of-range values are reported as no number.

Definition at line 28 of file parse_number.hpp.

References parse_number().

Referenced by parse_number(), to_double(), and to_float().

◆ rad_to_deg()

template<typename T>
T reusex::utils::rad_to_deg ( T radians)
inlineconstexpr

Convert radians to degrees.

Definition at line 17 of file math.hpp.

References rad_to_deg().

Referenced by rad_to_deg().

◆ remap()

template<typename T>
T reusex::utils::remap ( const T value,
const T min_in,
const T max_in,
const T min_out = T(0),
T max_out = T(1) )
inline

Definition at line 21 of file math.hpp.

References remap().

Referenced by remap().

◆ to_double()

double reusex::utils::to_double ( std::string_view s,
std::size_t * pos = nullptr )
inline

std::stod's contract without its locale: throws std::invalid_argument when s does not start with a number; pos gets the characters used.

Definition at line 51 of file parse_number.hpp.

References parse_number(), and to_double().

Referenced by to_double().

◆ to_float()

float reusex::utils::to_float ( std::string_view s,
std::size_t * pos = nullptr )
inline

std::stof's contract without its locale.

Definition at line 62 of file parse_number.hpp.

References parse_number(), and to_float().

Referenced by to_float().