master
ブランチ master
ShaderPlayground / deps / glm / glm / gtx / bit.hpp
3 KB、98行 生 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#endif
21
22#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
23# pragma message("GLM: GLM_GTX_bit extension is deprecated, include GLM_GTC_bitfield and GLM_GTC_integer instead")
24#endif
25
26namespace glm
27{
28 /// @addtogroup gtx_bit
29 /// @{
30
31 /// @see gtx_bit
32 template<typename genIUType>
33 GLM_FUNC_DECL genIUType highestBitValue(genIUType Value);
34
35 /// @see gtx_bit
36 template<typename genIUType>
37 GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value);
38
39 /// Find the highest bit set to 1 in a integer variable and return its value.
40 ///
41 /// @see gtx_bit
42 template<length_t L, typename T, qualifier Q>
43 GLM_FUNC_DECL vec<L, T, Q> highestBitValue(vec<L, T, Q> const& value);
44
45 /// Return the power of two number which value is just higher the input value.
46 /// Deprecated, use ceilPowerOfTwo from GTC_round instead
47 ///
48 /// @see gtc_round
49 /// @see gtx_bit
50 template<typename genIUType>
51 GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
52
53 /// Return the power of two number which value is just higher the input value.
54 /// Deprecated, use ceilPowerOfTwo from GTC_round instead
55 ///
56 /// @see gtc_round
57 /// @see gtx_bit
58 template<length_t L, typename T, qualifier Q>
59 GLM_DEPRECATED GLM_FUNC_DECL vec<L, T, Q> powerOfTwoAbove(vec<L, T, Q> const& value);
60
61 /// Return the power of two number which value is just lower the input value.
62 /// Deprecated, use floorPowerOfTwo from GTC_round instead
63 ///
64 /// @see gtc_round
65 /// @see gtx_bit
66 template<typename genIUType>
67 GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value);
68
69 /// Return the power of two number which value is just lower the input value.
70 /// Deprecated, use floorPowerOfTwo from GTC_round instead
71 ///
72 /// @see gtc_round
73 /// @see gtx_bit
74 template<length_t L, typename T, qualifier Q>
75 GLM_DEPRECATED GLM_FUNC_DECL vec<L, T, Q> powerOfTwoBelow(vec<L, T, Q> const& value);
76
77 /// Return the power of two number which value is the closet to the input value.
78 /// Deprecated, use roundPowerOfTwo from GTC_round instead
79 ///
80 /// @see gtc_round
81 /// @see gtx_bit
82 template<typename genIUType>
83 GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value);
84
85 /// Return the power of two number which value is the closet to the input value.
86 /// Deprecated, use roundPowerOfTwo from GTC_round instead
87 ///
88 /// @see gtc_round
89 /// @see gtx_bit
90 template<length_t L, typename T, qualifier Q>
91 GLM_DEPRECATED GLM_FUNC_DECL vec<L, T, Q> powerOfTwoNearest(vec<L, T, Q> const& value);
92
93 /// @}
94} //namespace glm
95
96
97#include "bit.inl"
98