| 0.9.6

- Main Page
- Modules
- Files

- File List

round.hpp
Go to the documentation of this file.
1
43 #pragma once
44
45 // Dependencies
46 #include "../detail/setup.hpp"
47 #include "../detail/precision.hpp"
48 #include "../detail/_vectorize.hpp"
49 #include "../vector_relational.hpp"
50 #include "../common.hpp"
51 #include <limits>
52
53 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
54 # pragma message("GLM: GLM_GTC_integer extension included")
55 #endif
56
57 namespace glm
58 {
61
65 template <typename genIUType>
66 GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value);
67
71 template <typename T, precision P, template <typename, precision> class vecType>
72 GLM_FUNC_DECL vecType<bool, P> isPowerOfTwo(vecType<T, P> const & value);
73
78 template <typename genIUType>
79 GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value);
80
85 template <typename T, precision P, template <typename, precision> class vecType>
86 GLM_FUNC_DECL vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & value);
87
92 template <typename genIUType>
93 GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value);
94
99 template <typename T, precision P, template <typename, precision> class vecType>
100 GLM_FUNC_DECL vecType<T, P> floorPowerOfTwo(vecType<T, P> const & value);
101
105 template <typename genIUType>
106 GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value);
107
111 template <typename T, precision P, template <typename, precision> class vecType>
112 GLM_FUNC_DECL vecType<T, P> roundPowerOfTwo(vecType<T, P> const & value);
113
117 template <typename genIUType>
118 GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple);
119
123 template <typename T, precision P, template <typename, precision> class vecType>
124 GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple);
125
129 template <typename T, precision P, template <typename, precision> class vecType>
130 GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple);
131
139 template <typename genType>
140 GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple);
141
149 template <typename T, precision P, template <typename, precision> class vecType>
150 GLM_FUNC_DECL vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple);
151
159 template <typename genType>
160 GLM_FUNC_DECL genType floorMultiple(
161 genType Source,
162 genType Multiple);
163
171 template <typename T, precision P, template <typename, precision> class vecType>
172 GLM_FUNC_DECL vecType<T, P> floorMultiple(
173 vecType<T, P> const & Source,
174 vecType<T, P> const & Multiple);
175
183 template <typename genType>
184 GLM_FUNC_DECL genType roundMultiple(
185 genType Source,
186 genType Multiple);
187
195 template <typename T, precision P, template <typename, precision> class vecType>
196 GLM_FUNC_DECL vecType<T, P> roundMultiple(
197 vecType<T, P> const & Source,
198 vecType<T, P> const & Multiple);
199
201 } //namespace glm
202
203 #include "round.inl"
glm::floorMultiple
GLM_FUNC_DECL vecType< T, P > floorMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Lower multiple number of Source.
glm::isMultiple
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::roundPowerOfTwo
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::isPowerOfTwo
GLM_FUNC_DECL vecType< bool, P > isPowerOfTwo(vecType< T, P > const &value)
Return true if the value is a power of two number.
glm::roundMultiple
GLM_FUNC_DECL vecType< T, P > roundMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Lower multiple number of Source.
glm::ceilMultiple
GLM_FUNC_DECL vecType< T, P > ceilMultiple(vecType< T, P > const &Source, vecType< T, P > const &Multiple)
Higher multiple number of Source.
glm::ceilPowerOfTwo
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
Definition: _noise.hpp:39
glm::floorPowerOfTwo
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...