GLM Version 0.9.0

bit.hpp

00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2007-03-14
00005 // Updated : 2008-11-14
00006 // Licence : This source is under MIT License
00007 // File    : glm/gtx/bit.hpp
00009 // Dependency:
00010 // - GLM core
00011 // - GLM_GTC_half_float
00013 
00014 #ifndef glm_gtx_bit
00015 #define glm_gtx_bit
00016 
00017 // Dependency:
00018 #include "../glm.hpp"
00019 #include "../gtc/half_float.hpp"
00020 
00021 namespace glm
00022 {
00023         namespace test{
00024                 void main_gtx_bit();
00025         }//namespace test
00026 
00027         namespace gtx{
00029         namespace bit
00030         {
00031                 using namespace gtc::half_float;
00032 
00035                 template <typename genIType>
00036                 genIType mask(genIType const & count);
00037 
00041                 template <typename genIUType, typename sizeType>
00042                 genIUType extractField(
00043                         genIUType const & v, 
00044                         sizeType const & first, 
00045                         sizeType const & count);
00046 
00049                 template <typename genType> 
00050                 int lowestBit(genType const & value);
00051 
00054                 template <typename genType> 
00055                 int highestBit(genType const & value);
00056 
00059                 template <typename genType> 
00060                 genType highestBitValue(genType const & value);
00061 
00064                 template <typename genType> 
00065                 bool isPowerOfTwo(genType const & value);
00066 
00069                 template <typename genType> 
00070                 genType powerOfTwoAbove(genType const & value);
00071 
00074                 template <typename genType> 
00075                 genType powerOfTwoBelow(genType const & value);
00076 
00079                 template <typename genType> 
00080                 genType powerOfTwoNearest(genType const & value);
00081 
00084                 template <typename genType> 
00085                 genType bitRevert(genType const & value);
00086 
00089                 template <typename genType>
00090                 genType bitRotateRight(genType const & In, std::size_t Shift);
00091 
00094                 template <typename genType>
00095                 genType bitRotateLeft(genType const & In, std::size_t Shift);
00096 
00097         }//namespace bit
00098         }//namespace gtx
00099 }//namespace glm
00100 
00101 #include "bit.inl"
00102 
00103 namespace glm{using namespace gtx::bit;}
00104 
00105 #endif//glm_gtx_bit