mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-13 17:20:09 +00:00
a/math: Add MIN, MAX and CLAMP macros
This commit is contained in:
parent
df5b5f40a9
commit
63b477d250
src/xrt
|
@ -50,6 +50,31 @@ extern "C" {
|
|||
*/
|
||||
#define MATH_GRAVITY_M_S2 (9.8066)
|
||||
|
||||
/*!
|
||||
* Minimum of A and B.
|
||||
*
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
#ifndef MIN // Avoid clash with OpenCV def
|
||||
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* Maximum of A and B.
|
||||
*
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
#ifndef MAX // Avoid clash with OpenCV def
|
||||
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* X clamped to the range [A, B].
|
||||
*
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
#define CLAMP(X, A, B) (MIN(MAX((X), (A)), (B)))
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* @ingroup aux_util
|
||||
*/
|
||||
|
||||
#include "math/m_api.h"
|
||||
#include "util/u_autoexpgain.h"
|
||||
#include "util/u_format.h"
|
||||
#include "util/u_misc.h"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "util/u_var.h"
|
||||
#include "util/u_sink.h"
|
||||
#include "tracking/t_frame_cv_mat_wrapper.hpp"
|
||||
#include "math/m_api.h"
|
||||
#include "math/m_filter_fifo.h"
|
||||
|
||||
#include "euroc_driver.h"
|
||||
|
@ -46,7 +47,6 @@ DEBUG_GET_ONCE_BOOL_OPTION(play_from_start, "EUROC_PLAY_FROM_START", false)
|
|||
DEBUG_GET_ONCE_BOOL_OPTION(print_progress, "EUROC_PRINT_PROGRESS", false)
|
||||
|
||||
#define EUROC_PLAYER_STR "Euroc Player"
|
||||
#define CLAMP(X, A, B) (MIN(MAX((X), (A)), (B)))
|
||||
|
||||
using std::async;
|
||||
using std::find_if;
|
||||
|
|
Loading…
Reference in a new issue