master
ブランチ master
VulkanExample / dep / include / glm / gtx / bit.hpp
3 KB、97行 生 Blame 履歴
1/// @ref gtx_bit
2/// @file glm/gtx/bit.hpp
3///
4/// @see core (dependence)
5///
6/// @defgroup gtx_bit GLM_GTX_bit
7/// @ingroup gtx
8///
9/// Include <glm/gtx/bit.hpp> to use the features of this extension.
10///
11/// Allow to perform bit operations on integer values
12
13#pragma once
14
15// Dependencies
16#include "../gtc/bitfield.hpp"
17
18#ifndef GLM_ENABLE_EXPERIMENTAL
19# error "GLM: GLM_GTX_bit is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
20#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
21# pragma message("GLM: GLM_GTX_bit extension included")
22#endif
23
24namespace glm
25{
26 /// @addtogroup gtx_bit
27 /// @{
28
29 /// @see gtx_bit
30 template<typename genIUType>
31 GLM_FUNC_DECL genIUType highestBitValue(genIUType Value);
32
33 /// @see gtx_bit
34 template<typename genIUType>
35 GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value);
36
37 /// Find the highest bit set to 1 in a integer variable and return its value.
38 ///
39 /// @see gtx_bit
40 template<length_t L, typename T, qualifier Q>
41 GLM_FUNC_DECL vec<L, T, Q> highestBitValue(vec<L, T, Q> const& value);
42
43 /// Return the power of two number which value is just higher the input value.
44 ///
45 /// @see gtc_round
46 /// @see gtx_bit
47 template<typename genIUType>
48 [[deprecated("Use ceilPowerOfTwo from GTC_round instead")]]
49 GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
50
51 /// Return the power of two number which value is just higher the input value.
52 /// Deprecated, use ceilPowerOfTwo from GTC_round instead
53 ///
54 /// @see gtc_round
55 /// @see gtx_bit
56 template<length_t L, typename T, qualifier Q>
57 [[deprecated("Use ceilPowerOfTwo from GTC_round instead")]]
58 GLM_FUNC_DECL vec<L, T, Q> powerOfTwoAbove(vec<L, T, Q> const& value);
59
60 /// Return the power of two number which value is just lower the input value.
61 ///
62 /// @see gtc_round
63 /// @see gtx_bit
64 template<typename genIUType>
65 [[deprecated("Use floorPowerOfTwo from GTC_round instead")]]
66 GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value);
67
68 /// Return the power of two number which value is just lower the input value.
69 ///
70 /// @see gtc_round
71 /// @see gtx_bit
72 template<length_t L, typename T, qualifier Q>
73 [[deprecated("Use floorPowerOfTwo from GTC_round instead")]]
74 GLM_FUNC_DECL vec<L, T, Q> powerOfTwoBelow(vec<L, T, Q> const& value);
75
76 /// Return the power of two number which value is the closet to the input value.
77 ///
78 /// @see gtc_round
79 /// @see gtx_bit
80 template<typename genIUType>
81 [[deprecated("Use roundPowerOfTwo from GTC_round instead")]]
82 GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value);
83
84 /// Return the power of two number which value is the closet to the input value.
85 ///
86 /// @see gtc_round
87 /// @see gtx_bit
88 template<length_t L, typename T, qualifier Q>
89 [[deprecated("Use roundPowerOfTwo from GTC_round instead")]]
90 GLM_FUNC_DECL vec<L, T, Q> powerOfTwoNearest(vec<L, T, Q> const& value);
91
92 /// @}
93} //namespace glm
94
95
96#include "bit.inl"
97