lxgui
include
lxgui
utils_maths.hpp
1
#ifndef LXGUI_UTILS_MATHS_HPP
2
#define LXGUI_UTILS_MATHS_HPP
3
4
#include "lxgui/lxgui.hpp"
5
#include "lxgui/utils.hpp"
6
7
namespace
lxgui::utils
{
8
10
enum class
rounding_method
{
12
nearest
,
14
nearest_not_zero
,
16
up
,
18
down
19
};
20
28
float
round
(
float
value,
float
unit,
rounding_method
method);
29
30
}
// namespace lxgui::utils
31
32
#endif
lxgui::utils
Definition:
utils_exception.cpp:3
lxgui::utils::round
float round(float value, float unit, rounding_method method)
Round a floating point value to a specific unit and using a specific rounding method.
Definition:
utils_maths.cpp:8
lxgui::utils::rounding_method
rounding_method
Rounding method for points to pixels conversions.
Definition:
utils_maths.hpp:10
lxgui::utils::rounding_method::up
@ up
Equivalent to ceil()
lxgui::utils::rounding_method::down
@ down
Equivalent to floor()
lxgui::utils::rounding_method::nearest
@ nearest
Equivalent to round()
lxgui::utils::rounding_method::nearest_not_zero
@ nearest_not_zero
Equivalent to round() but only returns 0 if input is exactly 0.
Generated on Sun Oct 8 2023 09:07:52 for lxgui by
1.9.1