41 #include <visp3/core/vpEndian.h> 51 return (((val >> 8) & 0x00FF) | ((val << 8) & 0xFF00));
60 return (((val >> 24) & 0x000000FF) | ((val >> 8) & 0x0000FF00) | ((val << 8) & 0x00FF0000) |
61 ((val << 24) & 0xFF000000));
76 dat2.b[0] = dat1.b[3];
77 dat2.b[1] = dat1.b[2];
78 dat2.b[2] = dat1.b[1];
79 dat2.b[3] = dat1.b[0];
95 dat2.b[0] = dat1.b[7];
96 dat2.b[1] = dat1.b[6];
97 dat2.b[2] = dat1.b[5];
98 dat2.b[3] = dat1.b[4];
99 dat2.b[4] = dat1.b[3];
100 dat2.b[5] = dat1.b[2];
101 dat2.b[6] = dat1.b[1];
102 dat2.b[7] = dat1.b[0];
113 #ifdef VISP_LITTLE_ENDIAN 114 return *
reinterpret_cast<uint16_t *
>(ptr);
115 #elif defined(VISP_BIG_ENDIAN) 116 return swap16bits(*reinterpret_cast<uint16_t *>(ptr));
118 throw std::runtime_error(
"Not supported endianness for correct custom reinterpret_cast() function.");
VISP_EXPORT uint16_t reinterpret_cast_uchar_to_uint16_LE(unsigned char *const ptr)
VISP_EXPORT float swapFloat(float f)
VISP_EXPORT uint16_t swap16bits(uint16_t val)
VISP_EXPORT double swapDouble(double d)
VISP_EXPORT uint32_t swap32bits(uint32_t val)