21 #ifndef __vtkByteSwapper_h__
22 #define __vtkByteSwapper_h__
40 static inline void Swap(
char*) {}
47 static inline void Swap(
char* data)
49 const uint16_t& ref16 = *
reinterpret_cast<uint16_t*
>(data);
50 *
reinterpret_cast<uint16_t*
>(data) = (ref16 >> 8) | (ref16 << 8);
58 static inline void Swap(
char* data)
60 const uint32_t& ref32 = *
reinterpret_cast<uint32_t*
>(data);
61 *
reinterpret_cast<uint32_t*
>(data) =
62 (ref32 >> 24) | (ref32 << 24) | ((ref32 & 0x00ff0000) >> 8) | ((ref32 & 0x0000ff00) << 8);
70 static inline void Swap(
char* data)
72 const uint64_t& ref64 = *
reinterpret_cast<uint64_t*
>(data);
73 *
reinterpret_cast<uint64_t*
>(data) = (ref64 >> 56) | (ref64 << 56) |
74 ((ref64 & 0x00ff000000000000) >> 40) | ((ref64 & 0x000000000000ff00) << 40) |
75 ((ref64 & 0x0000ff0000000000) >> 24) | ((ref64 & 0x0000000000ff0000) << 24) |
76 ((ref64 & 0x000000ff00000000) >> 8) | ((ref64 & 0x00000000ff000000) << 8);
96 #endif //__vtkByteSwapper_h__