Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::Bit Namespace Reference

Gray code based functions. More...

Functions

template<class D >
Invert (D num, size_t bit)
 Returns the input number with the expected bit inverted. More...
 
template<class D >
Set (D num, size_t bit, char val)
 Returns the input number with the expected bit set to val. More...
 
template<class D >
Preset (D num, size_t bit)
 Returns the input number with preset bit. More...
 
template<class D >
Reset (D num, size_t bit)
 Returns the input number with reset bit. More...
 
template<class 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 >
Value (D num, size_t bit)
 Returns bit value. More...
 

Detailed Description

Gray code based functions.

Function Documentation

template<class D >
D Bial::Bit::Flip ( num,
size_t  bit 
)

Returns the input number with the expected bit fliped.

Date
2015/Apr/10
Parameters
numA gray code number.
bitA bit to be set [0, size -1].
Returns
Input number with bit fliped.
Warning
none.
template<class D >
D Bial::Bit::Invert ( num,
size_t  bit 
)

Returns the input number with the expected bit inverted.

Date
2015/Apr/10
Parameters
numA gray code number.
bitA bit to be inverted [0, size -1].
Returns
Input number with bit inverted
Warning
none.
template<class D >
bool Bial::Bit::IsOne ( num,
size_t  bit 
)

Returns true if bit is 1.

Date
2015/Apr/10
Parameters
numA gray code number.
bitA bit to be checked [0, size -1].
Returns
true if bit is 1.
Warning
none.
template<class D >
bool Bial::Bit::IsZero ( num,
size_t  bit 
)

Returns true if bit is 0.

Date
2015/Apr/10
Parameters
numA gray code number.
bitA bit to be checked [0, size -1].
Returns
true if bit is 0.
Warning
none.
template<class D >
D Bial::Bit::Preset ( num,
size_t  bit 
)

Returns the input number with preset bit.

Date
2015/Apr/10
Parameters
numA gray code number.
bitA bit to be preset [0, size -1].
Returns
Input number with preset bit
Warning
none.
template<class D >
D Bial::Bit::Reset ( num,
size_t  bit 
)

Returns the input number with reset bit.

Date
2015/Apr/10
Parameters
numA gray code number.
bitA bit to be reset [0, size -1].
Returns
Input number with reset bit.
Warning
none.
template<class D >
D Bial::Bit::Set ( num,
size_t  bit,
char  val 
)

Returns the input number with the expected bit set to val.

Date
2015/Apr/10
Parameters
numA gray code number.
bitA bit to be set [0, size -1].
val0 or 1.
Returns
Input number with bit set.
Warning
none.
template<class D >
D Bial::Bit::Value ( num,
size_t  bit 
)

Returns bit value.

Date
2015/Apr/10
Parameters
numA gray code number.
bitA bit to be checked [0, size -1].
Returns
bit value.
Warning
none.