MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ read_float()

float MayaFlux::Transitive::Protocol::read_float ( const uint8_t *  data,
size_t &  offset 
)
inline

Read a big-endian IEEE 754 float from a byte buffer.

Advances offset by 4. Caller must ensure offset + 4 <= buffer size.

Parameters
dataBuffer start.
offsetCurrent read position, advanced by 4 on return.

Definition at line 76 of file BinaryBuffer.hpp.

77{
78 uint32_t raw {};
79 std::memcpy(&raw, data + offset, 4);
80 offset += 4;
81 if constexpr (std::endian::native == std::endian::little) {
82 raw = std::byteswap(raw);
83 }
84 float val {};
85 std::memcpy(&val, &raw, 4);
86 return val;
87}

Referenced by MayaFlux::Core::OscParser::parse().

+ Here is the caller graph for this function: