Visual Servoing Platform  version 3.5.0 under development (2022-02-15)
vpEndian Namespace Reference

Functions

VISP_EXPORT uint16_t swap16bits (uint16_t val)
 
VISP_EXPORT uint32_t swap32bits (uint32_t val)
 
VISP_EXPORT float swapFloat (float f)
 
VISP_EXPORT double swapDouble (double d)
 
VISP_EXPORT uint16_t reinterpret_cast_uchar_to_uint16_LE (unsigned char *const ptr)
 

Function Documentation

◆ reinterpret_cast_uchar_to_uint16_LE()

uint16_t vpEndian::reinterpret_cast_uchar_to_uint16_LE ( unsigned char *const  ptr)

Reinterpret an array of unsigned char stored in a little-endian way into an uint16_t value.

Warning
Pointer must be valid and 16-bit must be correctly readable.

Definition at line 111 of file vpEndian.cpp.

References swap16bits().

Referenced by vpImage< bool >::getValue().

◆ swap16bits()

uint16_t vpEndian::swap16bits ( uint16_t  val)

Swap 16 bits by shifting to the right the first byte and by shifting to the left the second byte.

Examples:
testColorConversion.cpp.

Definition at line 49 of file vpEndian.cpp.

Referenced by vpIoTools::readBinaryValueLE(), reinterpret_cast_uchar_to_uint16_LE(), and vpIoTools::writeBinaryValueLE().

◆ swap32bits()

uint32_t vpEndian::swap32bits ( uint32_t  val)

Swap 32 bits by shifting to the right the first 2 bytes and by shifting to the left the last 2 bytes.

Definition at line 58 of file vpEndian.cpp.

Referenced by vpIoTools::readBinaryValueLE(), and vpIoTools::writeBinaryValueLE().

◆ swapDouble()

double vpEndian::swapDouble ( double  d)

Swap a double, the union is necessary because of the representation of a double in memory in IEEE 754.

Definition at line 87 of file vpEndian.cpp.

Referenced by vpIoTools::readBinaryValueLE(), and vpIoTools::writeBinaryValueLE().

◆ swapFloat()

float vpEndian::swapFloat ( float  f)

Swap a float, the union is necessary because of the representation of a float in memory in IEEE 754.

Definition at line 68 of file vpEndian.cpp.

Referenced by vpIoTools::readBinaryValueLE(), and vpIoTools::writeBinaryValueLE().