AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
BitManipulator.cs
Go to the documentation of this file.
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
// Licensed under the MIT License. See LICENSE in the project root for license information.
3
4
using
System
;
5
6
namespace
HoloToolkit
.Unity
7
{
11
public
class
BitManipulator
12
{
13
Int32 mask;
14
Int32 shift;
15
16
public
BitManipulator
(Int32 mask, Int32 shift)
17
{
18
this.mask = mask;
19
this.shift = shift;
20
}
21
22
public
Int32
GetBitsValue
(Int32 input)
23
{
24
return
(input & mask) >> shift;
25
}
26
27
public
void
SetBits
(ref Int32 value, Int32 bitsValue)
28
{
29
Int32 iT = bitsValue << shift;
30
iT = iT & mask;
31
value = value | iT;
32
}
33
}
34
}
HoloToolkit.Unity.BitManipulator.GetBitsValue
Int32 GetBitsValue(Int32 input)
Definition:
BitManipulator.cs:22
System
HoloToolkit.Unity.BitManipulator.SetBits
void SetBits(ref Int32 value, Int32 bitsValue)
Definition:
BitManipulator.cs:27
HoloToolkit
HoloToolkit.Unity.BitManipulator
Helper class for bit manipulation.
Definition:
BitManipulator.cs:11
HoloToolkit.Unity.BitManipulator.BitManipulator
BitManipulator(Int32 mask, Int32 shift)
Definition:
BitManipulator.cs:16
Assets
HoloToolkit
Utilities
Scripts
BitManipulator.cs
Generated by
1.8.12