• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /// @ref gtx_bit
2 /// @file glm/gtx/bit.hpp
3 ///
4 /// @see core (dependence)
5 /// @see gtc_half_float (dependence)
6 ///
7 /// @defgroup gtx_bit GLM_GTX_bit
8 /// @ingroup gtx
9 ///
10 /// @brief Allow to perform bit operations on integer values
11 ///
12 /// <glm/gtx/bit.hpp> need to be included to use these functionalities.
13 
14 #pragma once
15 
16 // Dependencies
17 #include "../gtc/bitfield.hpp"
18 
19 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
20 #	pragma message("GLM: GLM_GTX_bit extension is deprecated, include GLM_GTC_bitfield and GLM_GTC_integer instead")
21 #endif
22 
23 namespace glm
24 {
25 	/// @addtogroup gtx_bit
26 	/// @{
27 
28 	/// @see gtx_bit
29 	template <typename genIUType>
30 	GLM_FUNC_DECL genIUType highestBitValue(genIUType Value);
31 
32 	/// @see gtx_bit
33 	template <typename genIUType>
34 	GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value);
35 
36 	/// Find the highest bit set to 1 in a integer variable and return its value.
37 	///
38 	/// @see gtx_bit
39 	template <typename T, precision P, template <typename, precision> class vecType>
40 	GLM_FUNC_DECL vecType<T, P> highestBitValue(vecType<T, P> const & value);
41 
42 	/// Return the power of two number which value is just higher the input value.
43 	/// Deprecated, use ceilPowerOfTwo from GTC_round instead
44 	///
45 	/// @see gtc_round
46 	/// @see gtx_bit
47 	template <typename genIUType>
48 	GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
49 
50 	/// Return the power of two number which value is just higher the input value.
51 	/// Deprecated, use ceilPowerOfTwo from GTC_round instead
52 	///
53 	/// @see gtc_round
54 	/// @see gtx_bit
55 	template <typename T, precision P, template <typename, precision> class vecType>
56 	GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoAbove(vecType<T, P> const & value);
57 
58 	/// Return the power of two number which value is just lower the input value.
59 	/// Deprecated, use floorPowerOfTwo from GTC_round instead
60 	///
61 	/// @see gtc_round
62 	/// @see gtx_bit
63 	template <typename genIUType>
64 	GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value);
65 
66 	/// Return the power of two number which value is just lower the input value.
67 	/// Deprecated, use floorPowerOfTwo from GTC_round instead
68 	///
69 	/// @see gtc_round
70 	/// @see gtx_bit
71 	template <typename T, precision P, template <typename, precision> class vecType>
72 	GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoBelow(vecType<T, P> const & value);
73 
74 	/// Return the power of two number which value is the closet to the input value.
75 	/// Deprecated, use roundPowerOfTwo from GTC_round instead
76 	///
77 	/// @see gtc_round
78 	/// @see gtx_bit
79 	template <typename genIUType>
80 	GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value);
81 
82 	/// Return the power of two number which value is the closet to the input value.
83 	/// Deprecated, use roundPowerOfTwo from GTC_round instead
84 	///
85 	/// @see gtc_round
86 	/// @see gtx_bit
87 	template <typename T, precision P, template <typename, precision> class vecType>
88 	GLM_DEPRECATED GLM_FUNC_DECL vecType<T, P> powerOfTwoNearest(vecType<T, P> const & value);
89 
90 	/// @}
91 } //namespace glm
92 
93 
94 #include "bit.inl"
95 
96