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
00041 template <typename genIType>
00042 genIType mask(genIType const & count);
00043
00047 template <typename genIUType, typename sizeType>
00048 genIUType extractField(
00049 genIUType const & v,
00050 sizeType const & first,
00051 sizeType const & count);
00052
00055 template <typename genType>
00056 int lowestBit(genType const & value);
00057
00060 template <typename genType>
00061 int highestBit(genType const & value);
00062
00065 template <typename genType>
00066 genType highestBitValue(genType const & value);
00067
00070 template <typename genType>
00071 bool isPowerOfTwo(genType const & value);
00072
00075 template <typename genType>
00076 genType powerOfTwoAbove(genType const & value);
00077
00080 template <typename genType>
00081 genType powerOfTwoBelow(genType const & value);
00082
00085 template <typename genType>
00086 genType powerOfTwoNearest(genType const & value);
00087
00090 template <typename genType>
00091 genType bitRevert(genType const & value);
00092
00095 template <typename genType>
00096 genType bitRotateRight(genType const & In, std::size_t Shift);
00097
00100 template <typename genType>
00101 genType bitRotateLeft(genType const & In, std::size_t Shift);
00103
00104 }
00105 }
00106 }
00107
00108 #include "bit.inl"
00109
00110 namespace glm{using namespace gtx::bit;}
00111
00112 #endif//glm_gtx_bit