0.9.9 API documenation
bitfield.hpp
Go to the documentation of this file.
1 
14 #include "../detail/setup.hpp"
15 
16 #pragma once
17 
18 // Dependencies
19 #include "../detail/qualifier.hpp"
20 #include "../detail/type_int.hpp"
21 #include "../detail/_vectorize.hpp"
22 #include <limits>
23 
24 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
25 # pragma message("GLM: GLM_GTC_bitfield extension included")
26 #endif
27 
28 namespace glm
29 {
32 
36  template<typename genIUType>
37  GLM_FUNC_DECL genIUType mask(genIUType Bits);
38 
42  template<typename T, qualifier P, template<typename, qualifier> class vecIUType>
43  GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v);
44 
48  template<typename genIUType>
49  GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift);
50 
54  template<length_t L, typename T, qualifier P>
55  GLM_FUNC_DECL vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const & In, int Shift);
56 
60  template<typename genIUType>
61  GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift);
62 
66  template<length_t L, typename T, qualifier P>
67  GLM_FUNC_DECL vec<L, T, P> bitfieldRotateLeft(vec<L, T, P> const & In, int Shift);
68 
72  template<typename genIUType>
73  GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount);
74 
78  template<length_t L, typename T, qualifier P>
79  GLM_FUNC_DECL vec<L, T, P> bitfieldFillOne(vec<L, T, P> const & Value, int FirstBit, int BitCount);
80 
84  template<typename genIUType>
85  GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount);
86 
90  template<length_t L, typename T, qualifier P>
91  GLM_FUNC_DECL vec<L, T, P> bitfieldFillZero(vec<L, T, P> const & Value, int FirstBit, int BitCount);
92 
98  GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y);
99 
105  GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y);
106 
112  GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y);
113 
119  GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y);
120 
126  GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y);
127 
133  GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y);
134 
140  GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z);
141 
147  GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z);
148 
154  GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z);
155 
161  GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z);
162 
168  GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z);
169 
175  GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z);
176 
182  GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w);
183 
189  GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w);
190 
196  GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w);
197 
203  GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w);
204 
206 } //namespace glm
207 
208 #include "bitfield.inl"
GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w)
Interleaves the bits of x, y, z and w.
GLM_FUNC_DECL vec< L, T, P > bitfieldRotateRight(vec< L, T, P > const &In, int Shift)
Rotate all bits to the right.
Definition: _noise.hpp:11
GLM_FUNC_DECL vecIUType< T, P > mask(vecIUType< T, P > const &v)
Build a mask of 'count' bits.
GLM_FUNC_DECL vec< L, T, P > bitfieldRotateLeft(vec< L, T, P > const &In, int Shift)
Rotate all bits to the left.
GLM_FUNC_DECL vec< L, T, P > bitfieldFillZero(vec< L, T, P > const &Value, int FirstBit, int BitCount)
Set to 0 a range of bits.
GLM_FUNC_DECL vec< L, T, P > bitfieldFillOne(vec< L, T, P > const &Value, int FirstBit, int BitCount)
Set to 1 a range of bits.