The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/math: Add MIN, MAX and CLAMP macros

authored by

Mateo de Mayo and committed by
Jakob Bornecrantz
63b477d2 df5b5f40

+27 -1
+25
src/xrt/auxiliary/math/m_api.h
··· 50 50 */ 51 51 #define MATH_GRAVITY_M_S2 (9.8066) 52 52 53 + /*! 54 + * Minimum of A and B. 55 + * 56 + * @ingroup aux_math 57 + */ 58 + #ifndef MIN // Avoid clash with OpenCV def 59 + #define MIN(A, B) ((A) < (B) ? (A) : (B)) 60 + #endif 61 + 62 + /*! 63 + * Maximum of A and B. 64 + * 65 + * @ingroup aux_math 66 + */ 67 + #ifndef MAX // Avoid clash with OpenCV def 68 + #define MAX(A, B) ((A) > (B) ? (A) : (B)) 69 + #endif 70 + 71 + /*! 72 + * X clamped to the range [A, B]. 73 + * 74 + * @ingroup aux_math 75 + */ 76 + #define CLAMP(X, A, B) (MIN(MAX((X), (A)), (B))) 77 + 53 78 54 79 /* 55 80 *
+1
src/xrt/auxiliary/util/u_autoexpgain.c
··· 7 7 * @ingroup aux_util 8 8 */ 9 9 10 + #include "math/m_api.h" 10 11 #include "util/u_autoexpgain.h" 11 12 #include "util/u_format.h" 12 13 #include "util/u_misc.h"
+1 -1
src/xrt/drivers/euroc/euroc_player.cpp
··· 16 16 #include "util/u_var.h" 17 17 #include "util/u_sink.h" 18 18 #include "tracking/t_frame_cv_mat_wrapper.hpp" 19 + #include "math/m_api.h" 19 20 #include "math/m_filter_fifo.h" 20 21 21 22 #include "euroc_driver.h" ··· 46 47 DEBUG_GET_ONCE_BOOL_OPTION(print_progress, "EUROC_PRINT_PROGRESS", false) 47 48 48 49 #define EUROC_PLAYER_STR "Euroc Player" 49 - #define CLAMP(X, A, B) (MIN(MAX((X), (A)), (B))) 50 50 51 51 using std::async; 52 52 using std::find_if;