Visual Servoing Platform  version 3.4.0
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

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< Type >::getValue().

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.

Definition at line 49 of file vpEndian.cpp.

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

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().

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().

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().