1.0.2 API documentation: round.hpp Source File

| 1.0.2 API documentation

round.hpp
Go to the documentation of this file.
1
14 #pragma once
15
16 // Dependencies
17 #include "../detail/setup.hpp"
18 #include "../detail/qualifier.hpp"
19 #include "../detail/_vectorize.hpp"
20 #include "../vector_relational.hpp"
21 #include "../common.hpp"
22 #include <limits>
23
24 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
25 # pragma message("GLM: GLM_GTC_round extension included")
26 #endif
27
28 namespace glm
29 {
32
37 template<typename genIUType>
38 GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType v);
39
48 template<length_t L, typename T, qualifier Q>
49 GLM_FUNC_DECL vec<L, T, Q> ceilPowerOfTwo(vec<L, T, Q> const& v);
50
55 template<typename genIUType>
56 GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType v);
57
66 template<length_t L, typename T, qualifier Q>
67 GLM_FUNC_DECL vec<L, T, Q> floorPowerOfTwo(vec<L, T, Q> const& v);
68
72 template<typename genIUType>
73 GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType v);
74
82 template<length_t L, typename T, qualifier Q>
83 GLM_FUNC_DECL vec<L, T, Q> roundPowerOfTwo(vec<L, T, Q> const& v);
84
93 template<typename genType>
94 GLM_FUNC_DECL genType ceilMultiple(genType v, genType Multiple);
95
106 template<length_t L, typename T, qualifier Q>
107 GLM_FUNC_DECL vec<L, T, Q> ceilMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple);
108
117 template<typename genType>
118 GLM_FUNC_DECL genType floorMultiple(genType v, genType Multiple);
119
130 template<length_t L, typename T, qualifier Q>
131 GLM_FUNC_DECL vec<L, T, Q> floorMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple);
132
141 template<typename genType>
142 GLM_FUNC_DECL genType roundMultiple(genType v, genType Multiple);
143
154 template<length_t L, typename T, qualifier Q>
155 GLM_FUNC_DECL vec<L, T, Q> roundMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple);
156
158 } //namespace glm
159
160 #include "round.inl"
glm::floorPowerOfTwo
GLM_FUNC_DECL vec< L, T, Q > floorPowerOfTwo(vec< L, T, Q > const &v)
Return the power of two number which value is just lower the input value, round down to a power of tw...
glm::ceilPowerOfTwo
GLM_FUNC_DECL vec< L, T, Q > ceilPowerOfTwo(vec< L, T, Q > const &v)
Return the power of two number which value is just higher the input value, round up to a power of two...
glm::roundMultiple
GLM_FUNC_DECL vec< L, T, Q > roundMultiple(vec< L, T, Q > const &v, vec< L, T, Q > const &Multiple)
Lower multiple number of Source.
glm::floorMultiple
GLM_FUNC_DECL vec< L, T, Q > floorMultiple(vec< L, T, Q > const &v, vec< L, T, Q > const &Multiple)
Lower multiple number of Source.
glm::ceilMultiple
GLM_FUNC_DECL vec< L, T, Q > ceilMultiple(vec< L, T, Q > const &v, vec< L, T, Q > const &Multiple)
Higher multiple number of Source.
glm::roundPowerOfTwo
GLM_FUNC_DECL vec< L, T, Q > roundPowerOfTwo(vec< L, T, Q > const &v)
Return the power of two number which value is the closet to the input value.