0.9.6
bit.hpp
Go to the documentation of this file.
1 
39 #pragma once
40 
41 // Dependencies
42 #include "../gtc/bitfield.hpp"
43 
44 #if(defined(GLM_MESSAGES))
45 # pragma message("GLM: GLM_GTX_bit extension is deprecated, include GLM_GTC_bitfield and GLM_GTC_integer instead")
46 #endif
47 
48 namespace glm
49 {
52 
54  template <typename genIUType>
55  GLM_FUNC_DECL genIUType highestBitValue(genIUType Value);
56 
60  template <typename T, precision P, template <typename, precision> class vecType>
61  GLM_FUNC_DECL vecType<T, P> highestBitValue(vecType<T, P> const & value);
62 
66  template <typename genIUType>
67  GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
68 
72  template <typename T, precision P, template <typename, precision> class vecType>
73  GLM_FUNC_DECL vecType<T, P> powerOfTwoAbove(vecType<T, P> const & value);
74 
78  template <typename genIUType>
79  GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value);
80 
84  template <typename T, precision P, template <typename, precision> class vecType>
85  GLM_FUNC_DECL vecType<T, P> powerOfTwoBelow(vecType<T, P> const & value);
86 
90  template <typename genIUType>
91  GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value);
92 
96  template <typename T, precision P, template <typename, precision> class vecType>
97  GLM_FUNC_DECL vecType<T, P> powerOfTwoNearest(vecType<T, P> const & value);
98 
100 } //namespace glm
101 
102 
103 #include "bit.inl"
104 
GLM_FUNC_DECL vecType< T, P > powerOfTwoNearest(vecType< T, P > const &value)
Return the power of two number which value is the closet to the input value.
Definition: _noise.hpp:31
GLM_FUNC_DECL vecType< T, P > highestBitValue(vecType< T, P > const &value)
Find the highest bit set to 1 in a integer variable and return its value.
GLM_FUNC_DECL vecType< T, P > powerOfTwoAbove(vecType< T, P > const &value)
Return the power of two number which value is just higher the input value.
GLM_FUNC_DECL vecType< T, P > powerOfTwoBelow(vecType< T, P > const &value)
Return the power of two number which value is just lower the input value.