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
00021 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
00022 # pragma message("GLM: GLM_GTX_bit extension included")
00023 #endif
00024
00025 namespace glm
00026 {
00027 namespace test{
00028 void main_gtx_bit();
00029 }
00030
00031 namespace gtx{
00033 namespace bit
00034 {
00035 using namespace gtc::half_float;
00036
00039
00042 template <typename genIType>
00043 genIType mask(genIType const & count);
00044
00048 template <typename genIUType, typename sizeType>
00049 genIUType extractField(
00050 genIUType const & v,
00051 sizeType const & first,
00052 sizeType const & count);
00053
00056 template <typename genType>
00057 int lowestBit(genType const & value);
00058
00061 template <typename genType>
00062 int highestBit(genType const & value);
00063
00066 template <typename genType>
00067 genType highestBitValue(genType const & value);
00068
00071 template <typename genType>
00072 bool isPowerOfTwo(genType const & value);
00073
00076 template <typename genType>
00077 genType powerOfTwoAbove(genType const & value);
00078
00081 template <typename genType>
00082 genType powerOfTwoBelow(genType const & value);
00083
00086 template <typename genType>
00087 genType powerOfTwoNearest(genType const & value);
00088
00091 template <typename genType>
00092 genType bitRevert(genType const & value);
00093
00096 template <typename genType>
00097 genType bitRotateRight(genType const & In, std::size_t Shift);
00098
00101 template <typename genType>
00102 genType bitRotateLeft(genType const & In, std::size_t Shift);
00103
00105
00106 }
00107 }
00108 }
00109
00110 #include "bit.inl"
00111
00112 namespace glm{using namespace gtx::bit;}
00113
00114 #endif//glm_gtx_bit