| 17 | using PJ::sdk::PointField; |
| 18 | |
| 19 | float readFloat32At(const uint8_t* data) { |
| 20 | const uint32_t bits = static_cast<uint32_t>(data[0]) | (static_cast<uint32_t>(data[1]) << 8) | |
| 21 | (static_cast<uint32_t>(data[2]) << 16) | (static_cast<uint32_t>(data[3]) << 24); |
| 22 | return std::bit_cast<float>(bits); |
| 23 | } |
| 24 | |
| 25 | // Hot-path float read for the bounds scan. On a little-endian host (every PJ target) a memcpy |
| 26 | // is a single (possibly unaligned) load the compiler vectorizes — ~10x cheaper than |
no outgoing calls