0.9.9 API documenation
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_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
25 # pragma message("GLM: GLM_GTC_integer extension included")
26 #endif
27 
28 namespace glm
29 {
32 
36  template<typename genIUType>
37  GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value);
38 
46  template<length_t L, typename T, qualifier Q>
47  GLM_FUNC_DECL vec<L, bool, Q> isPowerOfTwo(vec<L, T, Q> const& value);
48 
53  template<typename genIUType>
54  GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value);
55 
64  template<length_t L, typename T, qualifier Q>
65  GLM_FUNC_DECL vec<L, T, Q> ceilPowerOfTwo(vec<L, T, Q> const& value);
66 
71  template<typename genIUType>
72  GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value);
73 
82  template<length_t L, typename T, qualifier Q>
83  GLM_FUNC_DECL vec<L, T, Q> floorPowerOfTwo(vec<L, T, Q> const& value);
84 
88  template<typename genIUType>
89  GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value);
90 
98  template<length_t L, typename T, qualifier Q>
99  GLM_FUNC_DECL vec<L, T, Q> roundPowerOfTwo(vec<L, T, Q> const& value);
100 
104  template<typename genIUType>
105  GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple);
106 
114  template<length_t L, typename T, qualifier Q>
115  GLM_FUNC_DECL vec<L, bool, Q> isMultiple(vec<L, T, Q> const& Value, T Multiple);
116 
124  template<length_t L, typename T, qualifier Q>
125  GLM_FUNC_DECL vec<L, bool, Q> isMultiple(vec<L, T, Q> const& Value, vec<L, T, Q> const& Multiple);
126 
133  template<typename genType>
134  GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple);
135 
144  template<length_t L, typename T, qualifier Q>
145  GLM_FUNC_DECL vec<L, T, Q> ceilMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple);
146 
153  template<typename genType>
154  GLM_FUNC_DECL genType floorMultiple(genType Source, genType Multiple);
155 
164  template<length_t L, typename T, qualifier Q>
165  GLM_FUNC_DECL vec<L, T, Q> floorMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple);
166 
173  template<typename genType>
174  GLM_FUNC_DECL genType roundMultiple(genType Source, genType Multiple);
175 
184  template<length_t L, typename T, qualifier Q>
185  GLM_FUNC_DECL vec<L, T, Q> roundMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple);
186 
188 } //namespace glm
189 
190 #include "round.inl"
GLM_FUNC_DECL vec< L, T, Q > roundMultiple(vec< L, T, Q > const &Source, vec< L, T, Q > const &Multiple)
Lower multiple number of Source.
GLM_FUNC_DECL vec< L, bool, Q > isMultiple(vec< L, T, Q > const &Value, vec< L, T, Q > const &Multiple)
Return true if the 'Value' is a multiple of 'Multiple'.
Definition: common.hpp:20
GLM_FUNC_DECL vec< L, T, Q > ceilPowerOfTwo(vec< L, T, Q > const &value)
Return the power of two number which value is just higher the input value, round up to a power of two...
GLM_FUNC_DECL vec< L, T, Q > floorPowerOfTwo(vec< L, T, Q > const &value)
Return the power of two number which value is just lower the input value, round down to a power of tw...
GLM_FUNC_DECL vec< L, bool, Q > isPowerOfTwo(vec< L, T, Q > const &value)
Return true if the value is a power of two number.
GLM_FUNC_DECL vec< L, T, Q > ceilMultiple(vec< L, T, Q > const &Source, vec< L, T, Q > const &Multiple)
Higher multiple number of Source.
GLM_FUNC_DECL vec< L, T, Q > roundPowerOfTwo(vec< L, T, Q > const &value)
Return the power of two number which value is the closet to the input value.
GLM_FUNC_DECL vec< L, T, Q > floorMultiple(vec< L, T, Q > const &Source, vec< L, T, Q > const &Multiple)
Lower multiple number of Source.