0.9.7: bitfield.hpp Source File

| 0.9.7

- Main Page
- Modules
- Files

- File List

bitfield.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/type_int.hpp"
49 #include "../detail/_vectorize.hpp"
50 #include <limits>
51
52 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
53 # pragma message("GLM: GLM_GTC_bitfield extension included")
54 #endif
55
56 namespace glm
57 {
60
64 template <typename genIUType>
65 GLM_FUNC_DECL genIUType mask(genIUType Bits);
66
70 template <typename T, precision P, template <typename, precision> class vecIUType>
71 GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v);
72
76 template <typename genIUType>
77 GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift);
78
82 template <typename T, precision P, template <typename, precision> class vecType>
83 GLM_FUNC_DECL vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift);
84
88 template <typename genIUType>
89 GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift);
90
94 template <typename T, precision P, template <typename, precision> class vecType>
95 GLM_FUNC_DECL vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift);
96
100 template <typename genIUType>
101 GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount);
102
106 template <typename T, precision P, template <typename, precision> class vecType>
107 GLM_FUNC_DECL vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount);
108
112 template <typename genIUType>
113 GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount);
114
118 template <typename T, precision P, template <typename, precision> class vecType>
119 GLM_FUNC_DECL vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount);
120
126 GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y);
127
133 GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y);
134
140 GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y);
141
147 GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y);
148
154 GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y);
155
161 GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y);
162
168 GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z);
169
175 GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z);
176
182 GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z);
183
189 GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z);
190
196 GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z);
197
203 GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z);
204
210 GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w);
211
217 GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w);
218
224 GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w);
225
231 GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w);
232
234 } //namespace glm
235
236 #include "bitfield.inl"
glm::bitfieldFillOne
GLM_FUNC_DECL vecType< T, P > bitfieldFillOne(vecType< T, P > const &Value, int FirstBit, int BitCount)
Set to 1 a range of bits.
glm::bitfieldFillZero
GLM_FUNC_DECL vecType< T, P > bitfieldFillZero(vecType< T, P > const &Value, int FirstBit, int BitCount)
Set to 0 a range of bits.
glm::bitfieldRotateRight
GLM_FUNC_DECL vecType< T, P > bitfieldRotateRight(vecType< T, P > const &In, int Shift)
Rotate all bits to the right.
glm
Definition: _noise.hpp:40
glm::bitfieldRotateLeft
GLM_FUNC_DECL vecType< T, P > bitfieldRotateLeft(vecType< T, P > const &In, int Shift)
Rotate all bits to the left.
glm::mask
GLM_FUNC_DECL vecIUType< T, P > mask(vecIUType< T, P > const &v)
Build a mask of 'count' bits.
glm::bitfieldInterleave
GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w)
Interleaves the bits of x, y, z and w.