dlib.core.bitio

Bit-level manipulations

Members

Enums

Endian
enum Endian

Endianness

Functions

getBit
bool getBit(T b, uint pos)

Returns bit at position pos in integer b

hiNibble
T hiNibble(T b)

Returns high 4 bits of a byte

loNibble
T loNibble(T b)

Returns low 4 bits of a byte

setBit
T setBit(T b, uint pos, bool state)

Sets bit at position pos in integer b to state

swapEndian16
T swapEndian16(T n)

Returns 16-bit integer n with swapped endianness TODO: move to dlib.math.utils

Meta

Authors

Timur Gafarov