# GLM: bit.hpp Source File

- Main Page
- Namespaces
- Files

- File List

# bit.hpp

    00001
    00002 // OpenGL Mathematics Copyright (c) 2005 - 2009 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.h
    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 #include <limits>
    00021
    00022 namespace glm
    00023 {
    00024         namespace test{
    00025                 void main_gtx_bit();
    00026         }//namespace test
    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         }//namespace bit
    00096         }//namespace gtx
    00097 }//namespace glm
    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