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 
42  template<length_t L, typename T, qualifier P>
43  GLM_FUNC_DECL vec<L, bool, P> isPowerOfTwo(vec<L, T, P> const& value);
44 
49  template<typename genIUType>
50  GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value);
51 
56  template<length_t L, typename T, qualifier P>
57  GLM_FUNC_DECL vec<L, T, P> ceilPowerOfTwo(vec<L, T, P> const& value);
58 
63  template<typename genIUType>
64  GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value);
65 
70  template<length_t L, typename T, qualifier P>
71  GLM_FUNC_DECL vec<L, T, P> floorPowerOfTwo(vec<L, T, P> const& value);
72 
76  template<typename genIUType>
77  GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value);
78 
82  template<length_t L, typename T, qualifier P>
83  GLM_FUNC_DECL vec<L, T, P> roundPowerOfTwo(vec<L, T, P> const& value);
84 
88  template<typename genIUType>
89  GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple);
90 
94  template<length_t L, typename T, qualifier P>
95  GLM_FUNC_DECL vec<L, bool, P> isMultiple(vec<L, T, P> const& Value, T Multiple);
96 
100  template<length_t L, typename T, qualifier P>
101  GLM_FUNC_DECL vec<L, bool, P> isMultiple(vec<L, T, P> const& Value, vec<L, T, P> const& Multiple);
102 
109  template<typename genType>
110  GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple);
111 
118  template<length_t L, typename T, qualifier P>
119  GLM_FUNC_DECL vec<L, T, P> ceilMultiple(vec<L, T, P> const & Source, vec<L, T, P> const& Multiple);
120 
127  template<typename genType>
128  GLM_FUNC_DECL genType floorMultiple(genType Source, genType Multiple);
129 
136  template<length_t L, typename T, qualifier P>
137  GLM_FUNC_DECL vec<L, T, P> floorMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple);
138 
145  template<typename genType>
146  GLM_FUNC_DECL genType roundMultiple(genType Source, genType Multiple);
147 
154  template<length_t L, typename T, qualifier P>
155  GLM_FUNC_DECL vec<L, T, P> roundMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple);
156 
158 } //namespace glm
159 
160 #include "round.inl"
GLM_FUNC_DECL vec< L, T, P > ceilMultiple(vec< L, T, P > const &Source, vec< L, T, P > const &Multiple)
Higher multiple number of Source.
GLM_FUNC_DECL vec< L, bool, P > isMultiple(vec< L, T, P > const &Value, vec< L, T, P > const &Multiple)
Return true if the 'Value' is a multiple of 'Multiple'.
Definition: _noise.hpp:11
GLM_FUNC_DECL vec< L, bool, P > isPowerOfTwo(vec< L, T, P > const &value)
Return true if the value is a power of two number.
GLM_FUNC_DECL vec< L, T, P > ceilPowerOfTwo(vec< L, T, P > 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, P > roundPowerOfTwo(vec< L, T, P > const &value)
Return the power of two number which value is the closet to the input value.
GLM_FUNC_DECL vec< L, T, P > roundMultiple(vec< L, T, P > const &Source, vec< L, T, P > const &Multiple)
Lower multiple number of Source.
GLM_FUNC_DECL vec< L, T, P > floorMultiple(vec< L, T, P > const &Source, vec< L, T, P > const &Multiple)
Lower multiple number of Source.
GLM_FUNC_DECL vec< L, T, P > floorPowerOfTwo(vec< L, T, P > const &value)
Return the power of two number which value is just lower the input value, round down to a power of tw...