MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / swapByteOrder

Function swapByteOrder

Tools/MeshSkinning/main.cpp:1012–1018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1010// VTK expects big endian
1011template<typename T>
1012inline void swapByteOrder(T* v)
1013{
1014 constexpr size_t n = sizeof(T);
1015 uint8_t* bytes = reinterpret_cast<uint8_t*>(v);
1016 for (unsigned int c = 0u; c < n / 2; c++)
1017 std::swap(bytes[c], bytes[n - c - 1]);
1018}
1019
1020void exportVTK()
1021{

Callers 1

exportVTKFunction · 0.70

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected