00001
00002
00004
00005
00006
00007
00009
00010
00011
00013
00014 #ifndef glm_gtx_bit
00015 #define glm_gtx_bit
00016
00017
00018 #include "../glm.hpp"
00019 #include "../gtc/half_float.hpp"
00020 #include <limits>
00021
00022 namespace glm
00023 {
00024 namespace test{
00025 void main_gtx_bit();
00026 }
00027
00028 namespace gtx{
00030 namespace bit
00031 {
00032 using namespace gtc::half_float;
00033
00036 template <typename genIType>
00037 genIType mask(genIType const & count);
00038
00042 template <typename genType, typename genIType>
00043 genIType extractField(genType const & v, genIType const & first, genIType const & count);
00044
00047 template <typename genType>
00048 int lowestBit(genType const & value);
00049
00052 template <typename genType>
00053 int highestBit(genType const & value);
00054
00057 template <typename genType>
00058 genType highestBitValue(genType const & value);
00059
00062 template <typename genType>
00063 bool isPowerOfTwo(genType const & value);
00064
00067 template <typename genType>
00068 genType powerOfTwoAbove(genType const & value);
00069
00072 template <typename genType>
00073 genType powerOfTwoBelow(genType const & value);
00074
00077 template <typename genType>
00078 genType powerOfTwoNearest(genType const & value);
00079
00082 template <typename genType>
00083 genType bitRevert(genType const & value);
00084
00087 template <typename genType>
00088 genType bitRotateRight(genType const & In, std::size_t Shift);
00089
00092 template <typename genType>
00093 genType bitRotateLeft(genType const & In, std::size_t Shift);
00094
00095 }
00096 }
00097 }
00098
00099 #define GLM_GTX_bit namespace gtx::bit
00100 #ifndef GLM_GTX_GLOBAL
00101 namespace glm {using GLM_GTX_bit;}
00102 #endif//GLM_GTX_GLOBAL
00103
00104 #include "bit.inl"
00105
00106 #endif//glm_gtx_bit