Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
|
Gray code based functions. More...
Functions | |
template<class D > | |
D | Invert (D num, size_t bit) |
Returns the input number with the expected bit inverted. More... | |
template<class D > | |
D | Set (D num, size_t bit, char val) |
Returns the input number with the expected bit set to val. More... | |
template<class D > | |
D | Preset (D num, size_t bit) |
Returns the input number with preset bit. More... | |
template<class D > | |
D | Reset (D num, size_t bit) |
Returns the input number with reset bit. More... | |
template<class D > | |
D | Flip (D num, size_t bit) |
Returns the input number with the expected bit fliped. More... | |
template<class D > | |
bool | IsOne (D num, size_t bit) |
Returns true if bit is 1. More... | |
template<class D > | |
bool | IsZero (D num, size_t bit) |
Returns true if bit is 0. More... | |
template<class D > | |
D | Value (D num, size_t bit) |
Returns bit value. More... | |
Gray code based functions.
D Bial::Bit::Flip | ( | D | num, |
size_t | bit | ||
) |
Returns the input number with the expected bit fliped.
num | A gray code number. |
bit | A bit to be set [0, size -1]. |
D Bial::Bit::Invert | ( | D | num, |
size_t | bit | ||
) |
Returns the input number with the expected bit inverted.
num | A gray code number. |
bit | A bit to be inverted [0, size -1]. |
bool Bial::Bit::IsOne | ( | D | num, |
size_t | bit | ||
) |
Returns true if bit is 1.
num | A gray code number. |
bit | A bit to be checked [0, size -1]. |
bool Bial::Bit::IsZero | ( | D | num, |
size_t | bit | ||
) |
Returns true if bit is 0.
num | A gray code number. |
bit | A bit to be checked [0, size -1]. |
D Bial::Bit::Preset | ( | D | num, |
size_t | bit | ||
) |
Returns the input number with preset bit.
num | A gray code number. |
bit | A bit to be preset [0, size -1]. |
D Bial::Bit::Reset | ( | D | num, |
size_t | bit | ||
) |
Returns the input number with reset bit.
num | A gray code number. |
bit | A bit to be reset [0, size -1]. |
D Bial::Bit::Set | ( | D | num, |
size_t | bit, | ||
char | val | ||
) |
Returns the input number with the expected bit set to val.
num | A gray code number. |
bit | A bit to be set [0, size -1]. |
val | 0 or 1. |
D Bial::Bit::Value | ( | D | num, |
size_t | bit | ||
) |
Returns bit value.
num | A gray code number. |
bit | A bit to be checked [0, size -1]. |