0.9.6
bitfield.hpp
Go to the documentation of this file.
1 
39 #pragma once
40 
41 // Dependencies
42 #include "../detail/setup.hpp"
43 #include "../detail/precision.hpp"
44 #include "../detail/type_int.hpp"
45 #include "../detail/_vectorize.hpp"
46 #include <limits>
47 
48 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
49 # pragma message("GLM: GLM_GTC_bitfield extension included")
50 #endif
51 
52 namespace glm
53 {
56 
60  template <typename genIUType>
61  GLM_FUNC_DECL genIUType mask(genIUType Bits);
62 
66  template <typename T, precision P, template <typename, precision> class vecIUType>
67  GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v);
68 
72  template <typename genIUType>
73  GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift);
74 
78  template <typename T, precision P, template <typename, precision> class vecType>
79  GLM_FUNC_DECL vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift);
80 
84  template <typename genIUType>
85  GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift);
86 
90  template <typename T, precision P, template <typename, precision> class vecType>
91  GLM_FUNC_DECL vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift);
92 
96  template <typename genIUType>
97  GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount);
98 
102  template <typename T, precision P, template <typename, precision> class vecType>
103  GLM_FUNC_DECL vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount);
104 
108  template <typename genIUType>
109  GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount);
110 
114  template <typename T, precision P, template <typename, precision> class vecType>
115  GLM_FUNC_DECL vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount);
116 
122  GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y);
123 
129  GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y);
130 
136  GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y);
137 
143  GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y);
144 
150  GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y);
151 
157  GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y);
158 
164  GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z);
165 
171  GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z);
172 
178  GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z);
179 
185  GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z);
186 
192  GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z);
193 
199  GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z);
200 
206  GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w);
207 
213  GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w);
214 
220  GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w);
221 
227  GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w);
228 
230 } //namespace glm
231 
232 #include "bitfield.inl"
GLM_FUNC_DECL vecType< T, P > bitfieldRotateLeft(vecType< T, P > const &In, int Shift)
Rotate all bits to the left.
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 vecIUType< T, P > mask(vecIUType< T, P > const &v)
Build a mask of 'count' bits.
Definition: _noise.hpp:31
GLM_FUNC_DECL vecType< T, P > bitfieldFillZero(vecType< T, P > const &Value, int FirstBit, int BitCount)
Set to 0 a range of bits.
GLM_FUNC_DECL vecType< T, P > bitfieldFillOne(vecType< T, P > const &Value, int FirstBit, int BitCount)
Set to 1 a range of bits.
GLM_FUNC_DECL vecType< T, P > bitfieldRotateRight(vecType< T, P > const &In, int Shift)
Rotate all bits to the right.