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/precision.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 <typename T, precision P, template <typename, precision> class vecType>
43  GLM_FUNC_DECL vecType<bool, P> isPowerOfTwo(vecType<T, P> const & value);
44 
49  template <typename genIUType>
50  GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value);
51 
56  template <typename T, precision P, template <typename, precision> class vecType>
57  GLM_FUNC_DECL vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & value);
58 
63  template <typename genIUType>
64  GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value);
65 
70  template <typename T, precision P, template <typename, precision> class vecType>
71  GLM_FUNC_DECL vecType<T, P> floorPowerOfTwo(vecType<T, P> const & value);
72 
76  template <typename genIUType>
77  GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value);
78 
82  template <typename T, precision P, template <typename, precision> class vecType>
83  GLM_FUNC_DECL vecType<T, P> roundPowerOfTwo(vecType<T, P> const & value);
84 
88  template <typename genIUType>
89  GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple);
90 
94  template <typename T, precision P, template <typename, precision> class vecType>
95  GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple);
96 
100  template <typename T, precision P, template <typename, precision> class vecType>
101  GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple);
102 
110  template <typename genType>
111  GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple);
112 
120  template <typename T, precision P, template <typename, precision> class vecType>
121  GLM_FUNC_DECL vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple);
122 
130  template <typename genType>
131  GLM_FUNC_DECL genType floorMultiple(
132  genType Source,
133  genType Multiple);
134 
142  template <typename T, precision P, template <typename, precision> class vecType>
143  GLM_FUNC_DECL vecType<T, P> floorMultiple(
144  vecType<T, P> const & Source,
145  vecType<T, P> const & Multiple);
146 
154  template <typename genType>
155  GLM_FUNC_DECL genType roundMultiple(
156  genType Source,
157  genType Multiple);
158 
166  template <typename T, precision P, template <typename, precision> class vecType>
167  GLM_FUNC_DECL vecType<T, P> roundMultiple(
168  vecType<T, P> const & Source,
169  vecType<T, P> const & Multiple);
170 
172 } //namespace glm
173 
174 #include "round.inl"
GLM_FUNC_DECL vecType< bool, P > isPowerOfTwo(vecType< T, P > const &value)
Return true if the value is a power of two number.
GLM_FUNC_DECL vecType< bool, P > isMultiple(vecType< T, P > const &Value, vecType< T, P > const &Multiple)
Return true if the 'Value' is a multiple of 'Multiple'.
GLM_FUNC_DECL vecType< T, P > ceilMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Higher multiple number of Source.
GLM_FUNC_DECL vecType< T, P > roundPowerOfTwo(vecType< T, P > const &value)
Return the power of two number which value is the closet to the input value.
GLM_FUNC_DECL vecType< T, P > roundMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Lower multiple number of Source.
GLM_FUNC_DECL vecType< T, P > floorPowerOfTwo(vecType< 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...
Definition: _noise.hpp:11
GLM_FUNC_DECL vecType< T, P > ceilPowerOfTwo(vecType< 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 vecType< T, P > floorMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Lower multiple number of Source.