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 
46  template<length_t L, typename T, qualifier Q>
47  GLM_FUNC_DECL vec<L, T, Q> mask(vec<L, T, Q> const& v);
48 
52  template<typename genIUType>
53  GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift);
54 
62  template<length_t L, typename T, qualifier Q>
63  GLM_FUNC_DECL vec<L, T, Q> bitfieldRotateRight(vec<L, T, Q> const& In, int Shift);
64 
68  template<typename genIUType>
69  GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift);
70 
78  template<length_t L, typename T, qualifier Q>
79  GLM_FUNC_DECL vec<L, T, Q> bitfieldRotateLeft(vec<L, T, Q> const& In, int Shift);
80 
84  template<typename genIUType>
85  GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount);
86 
94  template<length_t L, typename T, qualifier Q>
95  GLM_FUNC_DECL vec<L, T, Q> bitfieldFillOne(vec<L, T, Q> const& Value, int FirstBit, int BitCount);
96 
100  template<typename genIUType>
101  GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount);
102 
110  template<length_t L, typename T, qualifier Q>
111  GLM_FUNC_DECL vec<L, T, Q> bitfieldFillZero(vec<L, T, Q> const& Value, int FirstBit, int BitCount);
112 
118  GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y);
119 
125  GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y);
126 
132  GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y);
133 
139  GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y);
140 
146  GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y);
147 
153  GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y);
154 
160  GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z);
161 
167  GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z);
168 
174  GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z);
175 
181  GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z);
182 
188  GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z);
189 
195  GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z);
196 
202  GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w);
203 
209  GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w);
210 
216  GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w);
217 
223  GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w);
224 
226 } //namespace glm
227 
228 #include "bitfield.inl"
GLM_FUNC_DECL vec< L, T, Q > bitfieldRotateLeft(vec< L, T, Q > 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.
Definition: common.hpp:20
GLM_FUNC_DECL vec< L, T, Q > mask(vec< L, T, Q > const &v)
Build a mask of 'count' bits.
GLM_FUNC_DECL vec< L, T, Q > bitfieldFillOne(vec< L, T, Q > const &Value, int FirstBit, int BitCount)
Set to 1 a range of bits.
GLM_FUNC_DECL vec< L, T, Q > bitfieldRotateRight(vec< L, T, Q > const &In, int Shift)
Rotate all bits to the right.
GLM_FUNC_DECL vec< L, T, Q > bitfieldFillZero(vec< L, T, Q > const &Value, int FirstBit, int BitCount)
Set to 0 a range of bits.